
i\c           @` s  d  Z  d d l m Z d d l m Z d d l m Z d d l Z d d l Z d d l Z d d l Z d d l	 Z	 d d l
 Z
 d d l m Z d d l m Z d d l Z d d l Z d d l Z d d l m Z d d	 l m Z d d
 l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m  Z  d d l m! Z! d d l m" Z" d d l m# Z# d d l m$ Z$ d d l m% Z% d d l m& Z& d d l m' Z' d d l( m) Z) d d l* m+ Z+ d d l, m- Z- d d l. m/ Z/ d d  l. m0 Z0 d d! l1 m2 Z2 d d" l1 m3 Z3 d d# l4 m5 Z5 d d$ l6 m7 Z7 d d% l6 m8 Z8 d&   Z9 d'   Z: d(   Z; d)   Z< d*   Z= e) d+ e>  d,    Z? d-   Z@ d.   ZA d/   ZB e) d0 e>  d1    ZC d d2  ZE d3 eF f d4     YZG d5 eG f d6     YZH d7 eH e jI f d8     YZJ d9 e jK eJ f d:     YZL d; eL f d<     YZM d d=  ZN d>   ZO d?   ZP d@ eJ f dA     YZQ dB eJ f dC     YZR dD eH f dE     YZS dF   ZT dG   ZU dH eF f dI     YZV dJ e jW f dK     YZX dL   ZY dM   ZZ dN   Z[ dO   Z\ d d d d dP  Z] dQ   Z^ dR   Z_ dS   Z` dT   Za dU dV  Zb dW eS e jc e jW f dX     YZd dY ed f dZ     YZe d S([   s9    Python test discovery, setup and run of test functions. i    (   t   absolute_import(   t   division(   t   print_functionN(   t   partial(   t   dedent(   t
   deprecated(   t   fixtures(   t   nodes(   t   filter_traceback(   t   ascii_escaped(   t   enum(   t   get_default_arg_names(   t   get_real_func(   t   getfslineno(   t	   getimfunc(   t   getlocation(   t   is_generator(   t   isclass(   t
   isfunction(   t   NOTSET(   t
   REGEX_TYPE(   t   safe_getattr(   t   safe_isclass(   t   safe_str(   t   STRING_TYPES(   t   hookimpl(   t   FSHookProxy(   t   MARK_GEN(   t   get_unpacked_marks(   t   normalize_mark_list(   t   fail(   t   skip(   t   parts(   t   PytestCollectionWarning(   t   PytestUnhandledCoroutineWarningc         ` s5     f d   } d   j    f } t | d  d  |  S(   Nc         ` s5   |  j  t t d      } | d  k	 r1 | j Sd  S(   Nt   pytest(   t	   getparentt   getattrt
   __import__t   Nonet   obj(   t   selft   node(   t   name(    s-   lib/python2.7/site-packages/_pytest/python.pyt   get5   s    s<   python %s object this node was collected from (can be None).(   t   lowert   propertyR'   (   R+   R,   t   doc(    (   R+   s-   lib/python2.7/site-packages/_pytest/python.pyt   pyobj_property4   s    c         C` s  |  j  d  } | j d d d d d d d t d	 d
 | j d d d d d d t d	 d |  j d d d d d d g d	 d |  j d d d d d g d	 d |  j d d d d d g d	 d |  j d d d d t d	 d | j d d d d d d  g d d! d	 d" d  S(#   Nt   generals
   --fixturess
   --funcargst   actiont
   store_truet   destt   showfixturest   defaultt   helpsi   show available fixtures, sorted by plugin appearance (fixtures with leading '_' are only shown with '-v')s   --fixtures-per-testt   show_fixtures_per_tests   show fixtures per testt   python_filest   typet   argss	   test_*.pys	   *_test.pys9   glob-style file patterns for Python test module discoveryt   python_classest   Tests6   prefixes or glob names for Python test class discoveryt   python_functionst   testsD   prefixes or glob names for Python test function and method discoverytD   disable_test_id_escaping_and_forfeit_all_rights_to_community_supportt   boolsc   disable string escape non-ascii characters, might cause unwanted side effects(use at your own risk)s   --import-modet   prependt   choicest   appendt
   importmodesN   prepend/append to sys.path when importing test modules, default is to prepend.(   t   getgroupt	   addoptiont   Falset   addini(   t   parsert   group(    (    s-   lib/python2.7/site-packages/_pytest/python.pyt   pytest_addoption@   sP    		c         C` s8   |  j  j r t |   d S|  j  j r4 t |   d Sd  S(   Ni    (   t   optionR5   R8   (   t   config(    (    s-   lib/python2.7/site-packages/_pytest/python.pyt   pytest_cmdline_mainw   s    

c         C` s   d d d g } xK | D]C } |  j  j |  r d } t | j |  j j |  d t q q Wx3 |  j  j d d  D] } |  j | j	 | j
   qs Wd  S(   Nt   parameterizet   parametriset   parameterises4   {0} has '{1}' mark, spelling should be 'parametrize't   pytraceR+   t   parametrize(   t
   definitiont   get_closest_markerR   t   formatt   functiont   __name__RH   t   iter_markersRT   R;   t   kwargs(   t   metafunct   alt_spellingst	   mark_namet   msgt   marker(    (    s-   lib/python2.7/site-packages/_pytest/python.pyt   pytest_generate_tests   s    )c         C` s$   |  j  d d  |  j  d d  d  S(   Nt   markerss  parametrize(argnames, argvalues): call a test function multiple times passing in different arguments in turn. argvalues generally needs to be a list of values if argnames specifies only one name or a list of tuples of values if argnames specifies multiple names. Example: @parametrize('arg1', [1,2]) would lead to two calls of the decorated test function, one with arg1=1 and another with arg1=2.see https://docs.pytest.org/en/latest/parametrize.html for more info and examples.s   usefixtures(fixturename1, fixturename2, ...): mark tests as needing all of the specified fixtures. see https://docs.pytest.org/en/latest/fixture.html#usefixtures (   t   addinivalue_line(   RN   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyt   pytest_configure   s    	t   trylastc         ` s   |  j  } t t d d   } | d  k	 r | |  r d } | d 7} | d 7} | d 7} | d 7} t j t | j |  j    t	 d d  n  |  j
     f d	   |  j j D } | |   t S(
   Nt   iscoroutinefunctionsF   Coroutine functions are not natively supported and have been skipped.
sM   You need to install a suitable plugin for your async framework, for example:
s     - pytest-asyncio
s     - pytest-trio
s     - pytest-tornasyncR_   s?   coroutine function and no async plugin installed (see warnings)c         ` s   i  |  ] }   | |  q S(    (    (   t   .0t   arg(   t   funcargs(    s-   lib/python2.7/site-packages/_pytest/python.pys
   <dictcomp>   s   	 (   R(   R%   t   inspectR'   t   warningst   warnR"   RW   t   nodeidR   Ri   t   _fixtureinfot   argnamest   True(   t
   pyfuncitemt   testfunctionRf   R_   t   testargs(    (   Ri   s-   lib/python2.7/site-packages/_pytest/python.pyt   pytest_pyfunc_call   s    	



	
c         C` s|   |  j  } | d k rx | j j |   sP t |  | j j d  d g  sP d  Sn  | j j |   } | j d |  d |  Sd  S(   Ns   .pyR9   s   __init__.pyt   patht   parent(   t   extt   sessiont
   isinitpatht   path_matches_patternsRN   t   getinit   gethookproxyt   pytest_pycollect_makemodule(   Ru   Rv   Rw   t   ihook(    (    s-   lib/python2.7/site-packages/_pytest/python.pyt   pytest_collect_file   s    	c         ` s   t    f d   | D  S(   s^   Returns True if the given py.path.local matches one of the patterns in the list of globs givenc         3` s   |  ] }   j  |  Vq d  S(   N(   t   fnmatch(   Rg   t   pattern(   Ru   (    s-   lib/python2.7/site-packages/_pytest/python.pys	   <genexpr>   s    (   t   any(   Ru   t   patterns(    (   Ru   s-   lib/python2.7/site-packages/_pytest/python.pyRz      s    c         C` s)   |  j  d k r t |  |  St |  |  S(   Ns   __init__.py(   t   basenamet   Packaget   Module(   Ru   Rv   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR}      s    t   hookwrapperc      
   c` s  d  V} | j    } | d  k	 r# d  St |  r` |  j | |  r| j t | d |   qn2|  j | |  rt | d |  } t |  p t t	 |   s t
 |  \ } } t j d t d |  d d  d t |  d | d  qt | d	 t  rt |  rgt | d |  } t j j d
 |  } | j t j d t d |   | j t |   n t |  j | |   } | j |  qn  d  S(   NRv   t   __func__t   messages/   cannot collect %r because it is not a function.t   categoryt   filenamet   linenoi   t   __test__R+   t   runt   reason(   t
   get_resultR'   R   t   istestclasst   force_resultt   Classt   istestfunctionR%   R   R   R   Rk   t   warn_explicitR!   t   strRp   R   t   FunctionR   t   YIELD_TESTSRW   t
   add_markerR   t   xfailRH   Rl   t   listt   _genfunctions(   t	   collectorR+   R(   t   outcomet   resR   R   R   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyt   pytest_pycollect_makeitem   s2    	c         C` s   d  S(   N(   R'   (   RN   t   valt   argname(    (    s-   lib/python2.7/site-packages/_pytest/python.pyt   pytest_make_parametrize_id   s    t   PyobjContextc           B` s,   e  Z e d   Z e d  Z e d  Z RS(   R   R   t   Instance(   RY   t
   __module__R0   t   modulet   clst   instance(    (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR      s   t
   PyobjMixinc           B` sY   e  Z e Z d    Z e d    Z e j d    Z d   Z e e	 d  Z
 d   Z RS(   c         O` s   t  t |   j | |   d  S(   N(   t   superR   t   __init__(   R)   t   kt   kw(    (    s-   lib/python2.7/site-packages/_pytest/python.pyR      s    c         C` s]   t  |  d d  } | d k rY |  j   |  _ } |  j rY |  j j t |  j   qY n  | S(   s   Underlying Python object.t   _objN(	   R%   R'   t   _getobjR   t   _ALLOW_MARKERSt   own_markerst   extendR   R(   (   R)   R(   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR(      s    	c         C` s   | |  _  d  S(   N(   R   (   R)   t   value(    (    s-   lib/python2.7/site-packages/_pytest/python.pyR(   
  s    c         C` s   t  |  j j |  j  S(   sD   Gets the underlying Python object. May be overwritten by subclasses.(   R%   Rv   R(   R+   (   R)   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR     s    c         C` s   |  j    } | j   g  } x | D]y } t | t  r> q# n  | j } t | t  r t j j |  d } | r | r | j	 |  n  Pq n  | j	 |  q# W| j   d j
 |  } | j d d  S(   s7    return python path relative to the containing module. i    t   .s   .[t   [(   t	   listchaint   reverset
   isinstanceR   R+   R   t   osRu   t   splitextRD   t   joint   replace(   R)   t   stopatmodulet   includemodulet   chainR    R*   R+   t   s(    (    s-   lib/python2.7/site-packages/_pytest/python.pyt
   getmodpath  s"    
	
c         C` s   |  j  } t | d d   } t | t  rb t j | j j } | j	 d  rY | d  } n  | } n t
 |  \ } } |  j   } t | t  s t  | | | f S(   Nt   compat_co_firstlinenos   .pyci(   R(   R%   R'   R   t   intt   syst   modulesR   t   __file__t   endswithR   R   t   AssertionError(   R)   R(   R   t   fspathR   t   modpath(    (    s-   lib/python2.7/site-packages/_pytest/python.pyt
   reportinfo&  s    		(   RY   R   Rp   R   R   R.   R(   t   setterR   RH   R   R   (    (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR      s   		t   PyCollectorc           B` sY   e  Z d    Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 RS(	   c         C` s   |  j  d |  S(   NR>   (   t   _matches_prefix_or_glob_option(   R)   R+   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyt   funcnamefilter8  s    c         C` s   t  | d t  t k S(   sg    Look for the __test__ attribute, which is applied by the
        @nose.tools.istest decorator
        R   (   R   RH   Rp   (   R)   R(   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyt
   isnosetest;  s    c         C` s   |  j  d |  S(   NR<   (   R   (   R)   R+   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyt   classnamefilterD  s    c         C` so   |  j  |  s |  j |  rg t | t  rB t | d t  } n  t | d t  of t j |  d  k St Sd  S(   NR   t   __call__(	   R   R   R   t   staticmethodR   RH   R   t   getfixturemarkerR'   (   R)   R(   R+   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR   G  s    c         C` s   |  j  |  p |  j |  S(   N(   R   R   (   R)   R(   R+   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR   S  s    c         C` sn   xg |  j  j |  D]S } | j |  r, t Sd | k sP d | k sP d | k r t j | |  r t Sq Wt S(   ss   
        checks if the given name matches the prefix or glob-pattern defined
        in ini configuration.
        t   *t   ?R   (   RN   R{   t
   startswithRp   R   RH   (   R)   t   option_nameR+   RM   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR   V  s    *c   	      C` s   t  |  j d t  s g  St  |  j d i   g } x- t j |  j j  D] } | j | j  qG Wi  } g  } x | D] } x t | j	    D]t \ } } | | k r q n  t | | <|  j
 | |  } | d  k r q n  t | t  s | g } n  | j |  q Wqt W| j d d    | S(   NR   t   __dict__t   keyc         S` s   |  j    d  S(   Ni   (   R   (   t   item(    (    s-   lib/python2.7/site-packages/_pytest/python.pyt   <lambda>}  t    (   R%   R(   Rp   Rj   t   getmrot	   __class__RD   R   R   t   itemst	   _makeitemR'   R   R   t   sort(	   R)   t   dictst   baseclst   seent   valuest   dicR+   R(   R   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyt   collectg  s(    
c         C` s   |  j  j d |  d | d |  S(   NR   R+   R(   (   R~   R   (   R)   R+   R(   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR     s    c         c` s  |  j  t  j } |  j  t  } | r0 | j p3 d  } |  j j } t d | d |  d |  } | j | | |  } t	 | | |  j
 d | d | }	 g  }
 t | d  r |
 j | j  n  t | d  r |
 j |   j  n  |
 r|  j j j |
 t d |	   n |  j j d |	  |	 j s>t | d |  d | Vn t j |  |	 |  | j   x` |	 j D]U } d	 | | j f } t d | d |  d
 | d | d | d i t | j 6d |  VqeWd  S(   NR+   Rv   t   callobjR   R   Ra   R\   t   fixtureinfos   %s[%s]t   callspect   keywordst   originalname(   R$   R   R(   R   R'   Rx   t   _fixturemanagert   FunctionDefinitiont   getfixtureinfot   MetafuncRN   t   hasattrRD   Ra   R~   t
   call_extrat   dictt   _callsR   R   t   add_funcarg_pseudo_fixture_deft   prune_dependency_treet   idRp   (   R)   R+   t   funcobjR   t   clscolR   t   fmRU   R   R\   t   methodsR   t   subname(    (    s-   lib/python2.7/site-packages/_pytest/python.pyR     s>    	
(   RY   R   R   R   R   R   R   R   R   R   R   (    (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR   7  s   									R   c           B` s;   e  Z d  Z d   Z d   Z d   Z d   Z d   Z RS(   s+    Collector for test classes and functions. c         C` s
   |  j    S(   N(   t   _importtestmodule(   R)   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR     s    c         C` s:   |  j    |  j   |  j j j |   t t |   j   S(   N(   t   _inject_setup_module_fixturet   _inject_setup_function_fixtureRx   R   t   parsefactoriesR   R   R   (   R)   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR     s    

c         ` s   t  |  j d      d k r3 t  |  j d    n  t  |  j d    d k rf t  |  j d   n    d k r  d k r d St j d t d d     f d	    } | |  j _ d S(
   s(  Injects a hidden autouse, module scoped fixture into the collected module object
        that invokes setUpModule/tearDownModule if either or both are available.

        Using a fixture to invoke this methods ensures we play nicely and unsurprisingly with
        other fixtures (#517).
        t   setUpModulet   setup_modulet   tearDownModulet   teardown_moduleNt   autouset   scopeR   c         3` sG     d  k	 r t   |  j  n  d  V d  k	 rC t  |  j  n  d  S(   N(   R'   t   _call_with_optional_argumentR   (   t   request(   R  R  (    s-   lib/python2.7/site-packages/_pytest/python.pyt   xunit_setup_module_fixture  s
    (   t   _get_non_fixture_funcR(   R'   R   t   fixtureRp   t   _Module__pytest_setup_module(   R)   R  (    (   R  R  s-   lib/python2.7/site-packages/_pytest/python.pyR     s    *c         ` sz   t  |  j d    t  |  j d     d k r@  d k r@ d St j d t d d     f d    } | |  j _ d S(   s0  Injects a hidden autouse, function scoped fixture into the collected module object
        that invokes setup_function/teardown_function if either or both are available.

        Using a fixture to invoke this methods ensures we play nicely and unsurprisingly with
        other fixtures (#517).
        t   setup_functiont   teardown_functionNR  R  RX   c         3` s_   |  j  d  k	 r d  Vd  S  d  k	 r7 t   |  j  n  d  V d  k	 r[ t  |  j  n  d  S(   N(   R   R'   R	  RX   (   R
  (   R  R  (    s-   lib/python2.7/site-packages/_pytest/python.pyt   xunit_setup_function_fixture  s    (   R  R(   R'   R   R  Rp   t   _Module__pytest_setup_function(   R)   R  (    (   R  R  s-   lib/python2.7/site-packages/_pytest/python.pyR    s    *c         C` s  |  j  j d  } y |  j j d |  } Wn]t k
 re |  j t j j j	   j
 d d    n&|  j j k
 r t j   d } |  j d | j   n t k
 rTd d l m } | j	   } |  j  j d	  d
 k  r | j j t  | _ n  | j r| j
 d d  n	 | j   } t |  } |  j d j d |  j d |    n7 t j j k
 r} | j rx  n  |  j d   n X|  j  j j |  | S(   Ns   --import-modet   ensuresyspatht   stylet   shorti   s   import file mismatch:
imported module %r has this __file__ attribute:
  %s
which is not the same as the test file we want to collect:
  %s
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modulesi    (   t   ExceptionInfot   verbosei   s   ImportError while importing test module '{fspath}'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
{traceback}R   t	   tracebacks   Using pytest.skip outside of a test is not allowed. To decorate a test function, use the @pytest.mark.skip or @pytest.mark.skipif decorators instead, and to skip a module use `pytestmark = pytest.mark.{skip,skipif}.(   RN   t	   getoptionR   t   pyimportt   SyntaxErrort   CollectErrort   _pytestt   _codeR  t   from_currentt   getreprt   ImportMismatchErrorR   t   exc_infoR;   t   ImportErrort   _pytest._code.codeR  t   filterR   t   exconlyR   RW   t   runnert   Skippedt   allow_module_levelt   pluginmanagert   consider_module(   R)   RE   t   modt   eR  R"  t   exc_reprt   formatted_tb(    (    s-   lib/python2.7/site-packages/_pytest/python.pyR     s:    $		(   RY   R   t   __doc__R   R   R   R  R   (    (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR     s   				R   c           B` sV   e  Z d d d d d   Z d   Z d   Z d   Z e d  Z d   Z	 d   Z
 RS(   c         C` se   | j  } t j j |  | d | d | d | d | | j |  _ | j |  _ | j |  _ | |  _ d  S(   NRv   RN   Rx   Rm   (	   Rx   R   t   FSCollectorR   t   dirnameR+   t   tracet   _norecursepatternsR   (   R)   R   Rv   RN   Rx   Rm   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR   +  s    		"c         C` s   t  |  j d  } | d  k r3 t  |  j d  } n  | d  k	 rR t | |  j  n  t  |  j d  } | d  k r t  |  j d  } n  | d  k	 r t t | |  j  } |  j |  n  d  S(   NR  R  R  R  (   R  R(   R'   R	  R   t   addfinalizer(   R)   R  R  t   func(    (    s-   lib/python2.7/site-packages/_pytest/python.pyt   setup5  s    c         C` s   | j  d k r t S|  j | j    } | j d | d |  j  rG d  Sx' |  j D] } | j d |  rQ t SqQ W|  j |  } | j d | d |   t	 S(   Nt   __pycache__Ru   RN   R   Rv   (
   R   RH   R|   t   dirpatht   pytest_ignore_collectRN   R4  t   checkt   pytest_collect_directoryRp   (   R)   R9  R~   t   pat(    (    s-   lib/python2.7/site-packages/_pytest/python.pyt   _recurseE  s    c         C` sX   |  j  j } | j |  } | j j |  } | rH t | | |  } n |  j  j } | S(   N(   RN   R*  t   _getconftestmodulest   _conftest_pluginst
   differenceR   t   hook(   R)   R   t   pmt   my_conftestmodulest   remove_modst   proxy(    (    s-   lib/python2.7/site-packages/_pytest/python.pyR|   R  s    c         C` s   | j    s: t d | | j   | j   | j   f   |  j |  } |  j |  sz | j d | d |  j  rz d Sn  | r |  j j	 d  } | s |  j j
 j } | | k r d S| j |  q n  |  j | k r |  g S| j d | d |   S(   Ns1   %r is not a file (isdir=%r, exists=%r, islink=%r)Ru   RN   t   keepduplicatesRv   (    (    (   t   isfileR   t   isdirt   existst   islinkR|   Ry   R:  RN   R  R*  t   _duplicatepathst   addR   R   (   R)   Ru   t   handle_dupesR~   RG  t   duplicate_paths(    (    s-   lib/python2.7/site-packages/_pytest/python.pyt   _collectfile`  s&    		c         C` s   | |  j  j k S(   N(   Rx   t   _initialpaths(   R)   Ru   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyRy   z  s    c         #` sj  |  j  j   } | j d  } | j d d  r\ t | |  j j d   r\ t | |   Vn  t   } x | j	 d |  j
 d t d t  D]   j   } | r  j d k r  j   | k r q q n  t  j    t    f d   | D  r q n  | r%x\ |  j   D] } | VqWq  j   s7q q  j d  j d d  r | j   q q Wd  S(	   Ns   __init__.pyt   filei   R9   t   rect   bfR   c         3` s0   |  ]& } |   k o' | j  d    k Vq d S(   s   __init__.pyN(   R   (   Rg   t
   pkg_prefix(   t   parts_Ru   (    s-   lib/python2.7/site-packages/_pytest/python.pys	   <genexpr>  s   (   R   R9  R   R;  Rz   RN   R{   R   t   sett   visitR>  Rp   RH  R   R    t   strpathR   RP  RI  RM  (   R)   t	   this_patht   init_modulet   pkg_prefixest   is_filet   x(    (   RV  Ru   s-   lib/python2.7/site-packages/_pytest/python.pyR   }  s.    	(!	N(   RY   R   R'   R   R7  R>  R|   Rp   RP  Ry   R   (    (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR   *  s   
				c         ` s|     d k	 r   n |    t |  |    d k	 rx  j j } t j   r[ | d 8} n  | rq    f d   S Sn  d S(   s^  
    Return a callable to perform xunit-style setup or teardown if
    the function exists in the ``holder`` object.
    The ``param_obj`` parameter is the parameter which will be passed to the function
    when the callable is called without arguments, defaults to the ``holder`` object.
    Return ``None`` if a suitable callable is not found.
    i   c           ` s
       S(   N(    (    (   t	   param_objt   result(    s-   lib/python2.7/site-packages/_pytest/python.pyR     R   N(   R'   R  t   __code__t   co_argcountRj   t   ismethod(   t   holdert	   attr_nameR_  t	   arg_count(    (   R_  R`  s-   lib/python2.7/site-packages/_pytest/python.pyt   _get_xunit_setup_teardown  s    	c         C` sF   |  j  j } t j |   r( | d 8} n  | r; |  |  n |    d S(   sx   Call the given function with the given argument if func accepts one argument, otherwise
    calls func without argumentsi   N(   Ra  Rb  Rj   Rc  (   R6  Rh   Rf  (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR	    s    c         C` s/   t  |  | d  } t j |  d k r+ | Sd S(   s   Return the attribute from the given object to be used as a setup/teardown
    xunit-style function, but only if not marked as a fixture to
    avoid calling it twice.
    N(   R%   R'   R   R   (   R(   R+   t   meth(    (    s-   lib/python2.7/site-packages/_pytest/python.pyR    s    R   c           B` s)   e  Z d  Z d   Z d   Z d   Z RS(   s    Collector for test methods. c         C` s   t  |  j d t  s g  St |  j  rU |  j t d |  j j |  j j f   g  St	 |  j  r |  j t d |  j j |  j j f   g  S|  j
   |  j   t d d d |   g S(   NR   sM   cannot collect test class %r because it has a __init__ constructor (from: %s)sL   cannot collect test class %r because it has a __new__ constructor (from: %s)R+   s   ()Rv   (   R   R(   Rp   t   hasinitRl   R!   RY   Rv   Rm   t   hasnewt   _inject_setup_class_fixturet   _inject_setup_method_fixtureR   (   R)   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR     s"    

c         ` s   t    j d   t   j d d    d k rC  d k rC d St j d t d d      f d    } |   j _ d S(   s&  Injects a hidden autouse, class scoped fixture into the collected class object
        that invokes setup_class/teardown_class if either or both are available.

        Using a fixture to invoke this methods ensures we play nicely and unsurprisingly with
        other fixtures (#517).
        t   setup_classt   teardown_classNR  R  t   classc         3` s_    d  k	 r+ t   } t |   j  n  d  V d  k	 r[ t   } t |   j  n  d  S(   N(   R'   R   R	  R(   (   R   R6  (   R)   Rm  Rn  (    s-   lib/python2.7/site-packages/_pytest/python.pyt   xunit_setup_class_fixture  s    (   R  R(   R%   R'   R   R  Rp   t   _Class__pytest_setup_class(   R)   Rp  (    (   R)   Rm  Rn  s-   lib/python2.7/site-packages/_pytest/python.pyRk    s    -
c         ` s}   t  |  j d    t |  j d d     d k rC  d k rC d St j d t d d     f d    } | |  j _ d S(   s+  Injects a hidden autouse, function scoped fixture into the collected class object
        that invokes setup_method/teardown_method if either or both are available.

        Using a fixture to invoke this methods ensures we play nicely and unsurprisingly with
        other fixtures (#517).
        t   setup_methodt   teardown_methodNR  R  RX   c         3` sh   | j  }   d  k	 r4 t |  d  } t | |  n  d  V d  k	 rd t |  d  } t | |  n  d  S(   NRr  Rs  (   RX   R'   R%   R	  (   R)   R
  t   methodR6  (   Rr  Rs  (    s-   lib/python2.7/site-packages/_pytest/python.pyt   xunit_setup_method_fixture
  s    	(   R  R(   R%   R'   R   R  Rp   t   _Class__pytest_setup_method(   R)   Ru  (    (   Rr  Rs  s-   lib/python2.7/site-packages/_pytest/python.pyRl    s    *(   RY   R   R0  R   Rk  Rl  (    (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR     s   		R   c           B` s)   e  Z e Z d    Z d   Z d   Z RS(   c         C` s   |  j  j   S(   N(   Rv   R(   (   R)   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR     s    c         C` s&   |  j  j j |   t t |   j   S(   N(   Rx   R   R  R   R   R   (   R)   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR   !  s    c         C` s   |  j    |  _ |  j S(   N(   R   R(   (   R)   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyt   newinstance%  s    (   RY   R   RH   R   R   R   Rw  (    (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR     s   		t   FunctionMixinc           B` s,   e  Z d  Z d   Z d   Z d d  Z RS(   s:    mixin for the code common to Function and Generator.
    c         C` s5   t  |  j t  r1 |  j j   |  j   |  _ n  d S(   s'    perform setup for this test function. N(   R   Rv   R   Rw  R   R(   (   R)   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR7  .  s    c         C` s6  t  |  d  r2|  j j d t  r2t j j t |  j   } | j	 | j
 } } | j } | j d | d |  } | | k r | j d |  } | | k r | j t  } | s | } q q n  | j   | _ |  j j d d  d k r2t | j  d k r/x( | j d d	 !D] } | j d
  qWq/q2n  d  S(   NR   t	   fulltraceRu   t   firstlinenot   tbstylet   autoi   i   iR  (   R   RN   R  RH   R  R  t   CodeR   R(   Ru   Rz  R  t   cutR%  R   t   lent   set_repr_style(   R)   t   excinfot   codeRu   Rz  R  t
   ntracebackt   entry(    (    s-   lib/python2.7/site-packages/_pytest/python.pyt   _prunetraceback4  s     %	c         C` sU   | d  k s t d   |  j j d d  } | d k rB d } n  |  j | d | S(   Ns   XXX outerr usage is deprecatedR{  R|  t   longR  (   R'   R   RN   R  t   _repr_failure_py(   R)   R  t   outerrR  (    (    s-   lib/python2.7/site-packages/_pytest/python.pyt   repr_failureI  s
    	N(   RY   R   R0  R7  R  R'   R  (    (    (    s-   lib/python2.7/site-packages/_pytest/python.pyRx  *  s   		c         C` s)   t  |  d d   } | r% | t j k Sd  S(   NR   (   R%   R'   t   objectR   (   R(   t   init(    (    s-   lib/python2.7/site-packages/_pytest/python.pyRi  Q  s    c         C` s)   t  |  d d   } | r% | t j k Sd  S(   Nt   __new__(   R%   R'   R  R  (   R(   t   new(    (    s-   lib/python2.7/site-packages/_pytest/python.pyRj  W  s    t	   CallSpec2c           B` sM   e  Z d    Z d   Z d   Z d   Z e d    Z d   Z d   Z	 RS(   c         C` sU   | |  _  i  |  _ g  |  _ i  |  _ t |  _ t |  _ i  |  _ g  |  _ i  |  _	 d  S(   N(
   R\   Ri   t   _idlistt   paramsR   t	   _globalidt   _globalparamt   _arg2scopenumt   markst   indices(   R)   R\   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR   ^  s    								c         C` s   t  |  j  } | j j |  j  | j j |  j  | j j |  j  | j j |  j  | j j |  j  t	 |  j
  | _
 |  j | _ |  j | _ | S(   N(   R  R\   Ri   t   updateR  R  R   R  R  R   R  R  R  (   R)   t   cs(    (    s-   lib/python2.7/site-packages/_pytest/python.pyt   copyi  s    c         C` s8   | |  j  k s | |  j k r4 t d | f   n  d  S(   Ns   duplicate %r(   R  Ri   t
   ValueError(   R)   Rh   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyt   _checkargnotcontainedu  s    c         C` sI   y |  j  | SWn3 t k
 rD |  j t k r= t |   n  |  j SXd  S(   N(   R  t   KeyErrorR  R   R  (   R)   R+   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyt   getparamy  s    c         C` s"   d j  t t t d  |  j    S(   Nt   -(   R   t   mapR   R%  R'   R  (   R)   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR     s    c         C` s   xa t  | |  D]P \ } }	 |  j |  | | }
 |	 t |  |
  | <| |  j | <| |  j | <q W|  j j |  |  j j t	 |   d  S(   N(
   t   zipR  R%   R  R  R  RD   R  R   R   (   R)   t   valtypesRo   t   valsetR   R  t   scopenumt   param_indexRh   R   t   valtype_for_arg(    (    s-   lib/python2.7/site-packages/_pytest/python.pyt	   setmulti2  s    
c         C` s   x | D] } |  j  |  q W|  j j |  | t k	 rM |  j j |  n  | t k	 rz |  j t k sn t  | |  _ n  x | D] } t j	 |  j
 | <q Wd  S(   N(   R  Ri   R  R   R  RD   R  R   R   t   scopenum_functionR  (   R)   Ri   R   t   paramR^  Rh   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyt   setall  s    (
   RY   R   R   R  R  R  R.   R   R  R  (    (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR  ]  s   					
R   c           B` sJ   e  Z d  Z d d d  Z e d d d  Z d   Z d   Z d   Z	 RS(   s-  
    Metafunc objects are passed to the :func:`pytest_generate_tests <_pytest.hookspec.pytest_generate_tests>` hook.
    They help to inspect a test function and to generate tests according to
    test configuration or values specified in the class or module where a
    test function is defined.
    c         C` s   t  | t  s* t |  j d k s* t  | |  _ | |  _ | |  _ | j |  _	 | j
 |  _ | |  _ g  |  _ t   |  _ | j |  _ d  S(   Nt   DefinitionMock(   R   R   R:   RY   R   RU   RN   R   R(   RX   t   names_closuret   fixturenamesR   R   RW  t   _idst   name2fixturedefst   _arg2fixturedefs(   R)   RU   R   RN   R   R   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR     s    					c      
   C` su  d d l  m } d d l m } | j | | |  j |  j d |  j \ } } ~ | d k rt t	 | |  j
 |  } n  |  j | |  |  j | |  }	 |  j | | | d |  j } | | d d j |  j j  }
 g  } x |  j p t |   g D]p } xg t t | |   D]P \ } \ } } | j   } | j |	 | | j | | j |
 |  | j |  qWq W| |  _ d S(	   s   Add new invocations to the underlying test function using the list
        of argvalues for the given argnames.  Parametrization is performed
        during the collection phase.  If you need to setup expensive resources
        see about setting indirect to do it rather at test setup time.

        :arg argnames: a comma-separated string denoting one or more argument
                       names, or a list/tuple of argument strings.

        :arg argvalues: The list of argvalues determines how often a
            test is invoked with different argument values.  If only one
            argname was specified argvalues is a list of values.  If N
            argnames were specified, argvalues must be a list of N-tuples,
            where each tuple-element specifies a value for its respective
            argname.

        :arg indirect: The list of argnames or boolean. A list of arguments'
            names (subset of argnames). If True the list contains all names from
            the argnames. Each argvalue corresponding to an argname in this list will
            be passed as request.param to its respective argname fixture
            function so that it can perform more expensive setups during the
            setup phase of a test rather than at collection time.

        :arg ids: list of string ids, or a callable.
            If strings, each is corresponding to the argvalues so that they are
            part of the test id. If None is given as id of specific test, the
            automatically generated id for that argument will be used.
            If callable, it should take one argument (a single argvalue) and return
            a string or return None. If None, the automatically generated id for that
            argument will be used.
            If no ids are provided they will be generated automatically from
            the argvalues.

        :arg scope: if specified it denotes the scope of the parameters.
            The scope is used for grouping tests by parameter instances.
            It will also override any fixture-function defined scope, allowing
            to set a dynamic scope using test context or configuration.
        i    (   t   scope2index(   t   ParameterSett   function_definitionR   t   descrs   parametrize() call in {}N(   t   _pytest.fixturesR  t   _pytest.markR  t   _for_parametrizeRX   RN   RU   R'   t   _find_parametrized_scopeR  t   _validate_if_using_arg_namest   _resolve_arg_value_typest   _resolve_arg_idsRW   RY   R   R  t	   enumerateR  R  R  R   R  RD   (   R)   Ro   t	   argvaluest   indirectt   idsR  R  R  t
   parameterst   arg_values_typesR  t   newcallsR   R  t   param_idt	   param_sett   newcallspec(    (    s-   lib/python2.7/site-packages/_pytest/python.pyRT     s<    &	(c   
      C` s  d d l  m } d } t |  r1 | } d } n  | r |  j j } t |  t |  k r d } t | j | t |  t |   d t	 n  xd | D]Y }	 |	 d k	 r t
 |	 t j  r d } t | j | | |	  t |	   d t	 q q Wn  t | | | | |  j d | } | S(   s  Resolves the actual ids for the given argnames, based on the ``ids`` parameter given
        to ``parametrize``.

        :param List[str] argnames: list of argument names passed to ``parametrize()``.
        :param ids: the ids parameter of the parametrized call (see docs).
        :param List[ParameterSet] parameters: the list of parameter values, same size as ``argnames``.
        :param Item item: the item that generated this parametrized call.
        :rtype: List[str]
        :return: the list of ids for each argname given
        i    (   t   safereprsD   In {}: {} parameter sets specified, with different number of ids: {}RS   s:   In {}: ids must be list of strings, found: {} (type: {!r})R   N(   t   _pytest._io.safereprR  R'   t   callableRX   RY   R  R   RW   RH   R   t   sixt   string_typesR:   t   idmakerRN   (
   R)   Ro   R  R  R   R  t   idfnt	   func_nameR_   t   id_value(    (    s-   lib/python2.7/site-packages/_pytest/python.pyR    s$    	.!!c         C` s   i  } | t  k r' t j | d  } n | t k rH t j | d  } nv t | t t f  r t j | d  } xL | D]A } | | k r t d j |  j	 j
 |  d t n  d | | <qv Wn  | S(   sw  Resolves if each parametrized argument must be considered a parameter to a fixture or a "funcarg"
        to the function, based on the ``indirect`` parameter of the parametrized() call.

        :param List[str] argnames: list of argument names passed to ``parametrize()``.
        :param indirect: same ``indirect`` parameter of ``parametrize()``.
        :rtype: Dict[str, str]
            A dict mapping each arg name to either:
            * "params" if the argname should be the parameter of a fixture of the same name.
            * "funcargs" if the argname should be a parameter to the parametrized test function.
        R  Ri   s*   In {}: indirect fixture '{}' doesn't existRS   (   Rp   R   t   fromkeysRH   R   t   tupleR   R   RW   RX   RY   (   R)   Ro   R  R  Rh   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR  0  s    
c         C` s   t  t |  j   } |  j j } x | D] } | |  j k r( | | k rh t d j | |  d t q t | t	 t
 f  r | | k r d n d } n | r d n d } t d j | | |  d t q( q( Wd S(   s5  
        Check if all argnames are being used, by default values, or directly/indirectly.

        :param List[str] argnames: list of argument names passed to ``parametrize()``.
        :param indirect: same ``indirect`` parameter of ``parametrize()``.
        :raise ValueError: if validation fails.
        sC   In {}: function already takes an argument '{}' with a default valueRS   R  t   arguments   In {}: function uses no {} '{}'N(   RW  R   RX   RY   R  R   RW   RH   R   R  R   (   R)   Ro   R  t   default_arg_namesR  Rh   R+   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR  M  s    
N(
   RY   R   R0  R'   R   RH   RT   R  R  R  (    (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR     s   R	 	c   
      C` s   d d l  m } t | t t f  r@ t |  t |   k } n t |  } | r | p[ i  } g  | j   D]% \ } } | |  k rk | d j ^ qk } | r x' t	 |  D] }	 |	 | k r |	 Sq Wq n  d S(   s}  Find the most appropriate scope for a parametrized call based on its arguments.

    When there's at least one direct argument, always use "function" scope.

    When a test function is parametrized and all its arguments are indirect
    (e.g. fixtures), return the most narrow scope based on the fixtures used.

    Related to issue #1832, based on code posted by @Kingdread.
    i    (   t   scopesRX   (
   R  R  R   R   R  R  RA   R   R  t   reversed(
   Ro   t   arg2fixturedefsR  R  t   all_arguments_are_fixturest   fixturedefsR+   t
   fixturedeft   used_scopesR  (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR  k  s    
c         C` s8   | d  k r t } n | j d  } | r. |  St |   S(   NR@   (   R'   RH   R{   R	   (   R   RN   t   escape_option(    (    s-   lib/python2.7/site-packages/_pytest/python.pyt   _ascii_escaped_by_config  s
    		c   
      C` s  | r y% | |   } | d  k	 r* | }  n  Wq t k
 r } d } | j | j | |  } | d j t |  j |  7} t j t |  |  q Xn4 | r | j	 j
 d | d |  d |  }	 |	 r |	 Sn  t |  t  r t |  |  S|  d  k st |  t t t f  rt |   St |  t  r1t |  j  St d  k	 rYt |  t j  rYt |   St |   sqt |   rt |  d  r|  j St |  t |  S(   NsO   {}: error raised while trying to determine id of parameter '{}' at position {}
s	     {}: {}
RN   R   R   RY   (   R'   t	   ExceptionRW   Rm   R:   RY   R  t
   raise_fromR  RB  R   R   R   R  t   floatR   RA   R   R   R	   R   R
   t   EnumR   R   R   (
   R   R   t   idxR  R   RN   t   generated_idR-  R_   t   hook_id(    (    s-   lib/python2.7/site-packages/_pytest/python.pyt   _idval  s4    $

'c   
      C` s   | j  d  k	 r | j  S| d  k sD |  t |  k sD | |  d  k r g  t | j |  D]- \ } } t | | |  | d | d | ^ qW }	 d j |	  St | |  |  Sd  S(   NR   RN   R  (   R   R'   R  R  R   R  R   R  (
   R  t   parametersetRo   R  R  R   RN   R   R   t   this_id(    (    s-   lib/python2.7/site-packages/_pytest/python.pyt	   _idvalset  s    .Cc         C` s   g  t  |  D]0 \ } } t | | |  | | d | d | ^ q } t t |   t |  k r g  | D]! } | j |  d k rh | ^ qh }	 t j d    }
 xT t  |  D]C \ } } | |	 k r | t |
 |  | | <|
 | c d 7<q q Wn  | S(   NRN   R   i   c           S` s   d S(   Ni    (    (    (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR     R   (   R  R  R  RW  t   countt   collectionst   defaultdictR   (   Ro   t   parametersetsR  R  RN   R   t   valindexR  t   testidt
   duplicatest   counterst   index(    (    s-   lib/python2.7/site-packages/_pytest/python.pyR    s    @.c         C` s   d d l  m } | |  t  S(   Ni    (   t   wrap_session(   t   _pytest.mainR  t   _show_fixtures_per_test(   RN   R  (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR8     s    c         ` s   d d  l  } | j   t j j     | j j |    |  j d     f d       f d       f d   } x | j D] } | |  q Wd  S(   Ni    R  c         ` s   t  |     }   j |  S(   N(   R   t   bestrelpath(   R6  t   loc(   t   curdir(    s-   lib/python2.7/site-packages/_pytest/python.pyt   get_best_relpath  s    c         ` s   |  j  }  d k r( | j d  r( d  S d k rX   |  j  } d j | |  } n | }  j | d t |  j j } | r t  |  n  j d d t d  S(   Ni    t   _s   {} -- {}t   greens       no docstring availablet   red(   R   R   R6  RW   t   lineRp   R0  t   write_docstring(   t   fixture_defR   t   bestrelt   funcargspect   fixture_doc(   R  t   twR  (    s-   lib/python2.7/site-packages/_pytest/python.pyt   write_fixture  s    	c         ` s   y |  j  } Wn t k
 r! d  SX| j s/ d  S j    j d d j |  j    j d d j   |  j    xO t | j j	    D]8 \ } } | d  k	 s t  | s q n   | d  q Wd  S(   NR  s   fixtures used by {}s   ({})i(   Rn   t   AttributeErrorR  R  t   sepRW   R+   RX   t   sortedR   R'   R   (   R   t   infoR  R  (   R  R  R  (    s-   lib/python2.7/site-packages/_pytest/python.pyt
   write_item  s    	
""(	   t   _pytest.configt   perform_collectt   pyRu   t   localRN   t   create_terminal_writert   getvalueR   (   RN   Rx   R  R  t   session_item(    (   R  R  R  R  R  s-   lib/python2.7/site-packages/_pytest/python.pyR    s    
c         C` s   d d l  m } | |  t  S(   Ni    (   R  (   R  R  t   _showfixtures_main(   RN   R  (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR5     s    c         C` s  d d  l  } | j   t j j   } | j j |   } |  j d  } | j } g  } t	   } x | j
 j   D] \ }	 }
 |
 d  k	 s t  |
 s qn n  x |
 D] } t | j |  } | j | f | k r q n  | j | j | f  | j t | j  | j j | j |  | j | f  q Wqn W| j   d  } xW| D]O\ } } } }	 } | | k r| j d  s| j   | j d d | f  | } qn  | d k r|	 d d k rq>n  | j |	 d t | j d k r| j d	 | j d
 t n  | d k r"| j d | d t n  | j d  t | j |  } | j j pPd } | rit | |  n | j d | f d t | j   q>Wd  S(   Ni    R  s   _pytest.R  s   fixtures defined from %sR  R  RX   s    [%s scope]t   cyans    -- %st   yellows   
R   s       %s: no docstring availableR  (    R  R  R  Ru   R  RN   R	  R
  R   RW  R  R   R'   R   R   R6  R   RM  RD   R  t   baseidR   R  R   R   R  R  t   writeRp   R  R0  R  (   RN   Rx   R  R  R  R  R   t	   availableR   R   R  R  R  t   currentmoduleR  R   R  R/   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR    sZ    
			

s       c         C` s   | j    } d | k r3 | j d d  \ } } n | d } } | j   rf |  j | | j    n  | r x5 t |  j d  D] } |  j | | d  q Wn  d  S(   Ns   
i   R   (   t   rstript   splitt   stripR  R   R  (   R  R/   t   indentt	   firstlinet   restR  (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR  M  s    R   c        	   B` sw   e  Z d  Z e Z d d d e d d d d d  Z d   Z e	 d    Z
 d   Z e	 d    Z d   Z d   Z RS(	   s]    a Function Item is responsible for setting up and executing a
    Python test function.
    c         C` s  t  t |   j | | d | d | | |  _ | t k	 rF | |  _ n  |  j j |  j j  |  j	 j
 t |  j   | r | |  _ x! | j D] } | |  j | j <q W|  j	 j
 t | j   n  | r |  j j |  n  |  j j t j g  |  j   D]! } | j |  j k r | j ^ q t   |	 d  k r]|  j j j |  |  j |  j d t }	 n  |	 |  _ |	 j |  _ |  j   |
 |  _ d  S(   NRN   Rx   Ri   (   R   R   R   t   _argsR   R(   R   R  R   R   R   R   R   R  R+   R   R   R  RZ   Rp   R'   Rx   R   R   R   Rn   R  R  t   _initrequestR   (   R)   R+   Rv   R;   RN   R   R   R   Rx   R   R   t   mark(    (    s-   lib/python2.7/site-packages/_pytest/python.pyR   d  s4    %			
	
c         C` s   i  |  _  t j |   |  _ d  S(   N(   Ri   R   t   FixtureRequestt   _request(   R)   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR    s    	c         C` s   t  |  j  S(   s#   underlying python 'function' object(   R   R(   (   R)   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyRX     s    c         C` sD   |  j  } | j d  } | d k r1 | |  } n  t |  j j |  S(   NR   i(   R+   t   findR%   Rv   R(   (   R)   R+   t   i(    (    s-   lib/python2.7/site-packages/_pytest/python.pyR     s
    	c         C` s   |  S(   s@   (compatonly) for code expecting pytest-2.2 style request objects(    (   R)   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyt   _pyfuncitem  s    c         C` s   |  j  j d |   d S(   s'    execute the underlying test function. Rq   N(   R~   Rt   (   R)   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyt   runtest  s    c         C` s$   t  t |   j   t j |   d  S(   N(   R   R   R7  R   t   fillfixtures(   R)   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR7    s    N(   RY   R   R0  RH   R   R'   R   R   R  R.   RX   R   R   R!  R7  (    (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR   \  s    2			R   c           B` s   e  Z d  Z d   Z e Z RS(   sd   
    internal hack until we get actual definition nodes instead of the
    crappy metafunc hack
    c         C` s   t  d   d  S(   Ns0   function definitions are not supposed to be used(   t   RuntimeError(   R)   (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR!    s    (   RY   R   R0  R!  R7  (    (    (    s-   lib/python2.7/site-packages/_pytest/python.pyR     s   	(f   R0  t
   __future__R    R   R   R  R   Rj   R   R   Rk   t	   functoolsR   t   textwrapR   R  R  R  R   R   R   t   _pytest._codeR   t   _pytest.compatR	   R
   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R  R   R  R   R  R   t   _pytest.mark.structuresR   R   t   _pytest.outcomesR   R   t   _pytest.pathlibR    t   _pytest.warning_typesR!   R"   R0   RL   RO   Ra   Rd   Rp   Rt   R   Rz   R}   R   R'   R   R  R   R   t	   CollectorR   t   FileR   R   Rg  R	  R  R   R   Rx  Ri  Rj  R  t   FuncargnamesCompatAttrR   R  R  R  R  R  R8   R  R5   R  R  t   ItemR   R   (    (    (    s-   lib/python2.7/site-packages/_pytest/python.pyt   <module>   s   		7							%?}vs		
P'		?	!	
	!			4		9"c