
^Yc           @` sh  d  Z  d d l m Z m Z m Z d d l Z d d l Z d d l m Z d d l Z d d l	 m
 Z
 m Z d   Z d   Z d   Z d	   Z d
 d5 d     YZ d   Z e d d  Z d   Z d   Z d   Z d   Z d   Z e d  Z d   Z d   Z d d6 d     YZ d   Z d e f d     YZ  d   Z! d e  f d     YZ" d e  f d     YZ# d    Z$ d! e  f d"     YZ% d# e
 f d$     YZ& d% e f d&     YZ' d'   Z( d( e) f d)     YZ* d* e* f d+     YZ+ d, e* f d-     YZ, d. e- f d/     YZ. d0   Z/ e. e/ _) d1 d2  Z0 e+ e0 _) d1 e d3  Z1 e, e1 _) d d4  Z2 d S(7   s4    basic collect and runtest protocol implementations i    (   t   absolute_importt   divisiont   print_functionN(   t   time(   t   TerminalReprt   ExceptionInfoc         C` sJ   |  j  d d d d } | j d d d d t d	 d  d
 d d d f d  S(   Ns   terminal reportingt	   reportingt   aftert   generals   --durationst   actiont   storet   typet   defaultt   metavart   Nt   helps2   show N slowest setup/test durations (N=0 for all).(   t   getgroupt	   addoptiont   intt   None(   t   parsert   group(    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyt   pytest_addoption   s    c         C` s  |  j  j j } | d  k r d  S|  } g  } xG | j j   D]6 } x- | D]% } t | d  rH | j |  qH qH Wq; W| s d  S| j d d    | j	   | s | j
 d d  n | j
 d d |  | |  } xC | D]; } | j j d d  } | j d	 | j | j | f  q Wd  S(
   Nt   durationt   keyc         S` s   |  j  S(   N(   R   (   t   x(    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyt   <lambda>"   s    t   =s   slowest test durationss   slowest %s test durationss   ::()::s   ::s   %02.2fs %-8s %s(   t   configt   optiont	   durationsR   t   statst   valuest   hasattrt   appendt   sortt   reverset	   write_sept   nodeidt   replacet
   write_lineR   t   when(   t   terminalreporterR   t   trt   dlistt   replistt   repR&   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyt   pytest_terminal_summary   s*    

	c         C` s   t    |  _ d  S(   N(   t
   SetupStatet   _setupstate(   t   session(    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyt   pytest_sessionstart/   s    c         C` s   |  j  j   d  S(   N(   R1   t   teardown_all(   R2   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyt   pytest_sessionfinish1   s    t   NodeInfoc           B` s   e  Z d    Z RS(   c         C` s   | |  _  d  S(   N(   t   location(   t   selfR7   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyt   __init__5   s    (   t   __name__t
   __module__R9   (    (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR6   4   s   c         C` s3   |  j  j d |  j d |  j  t |  d | t S(   NR&   R7   t   nextitem(   t   ihookt   pytest_runtest_logstartR&   R7   t   runtestprotocolt   True(   t   itemR<   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyt   pytest_runtest_protocol8   s    c         C` s   t  |  d  } | r, |  j r, |  j   n  t |  d |  } | g } | j r |  j j j rl t |   n  |  j j j	 s | j
 t |  d |   q n  | j
 t |  d | d |  | r t |  _ d  |  _ n  | S(   Nt   _requestt   setupt   callt   teardownR<   (   R!   RC   t   _initrequestt   call_and_reportt   passedR   R   t	   setupshowt   show_test_itemt	   setuponlyR"   t   FalseR   t   funcargs(   RA   t   logR<   t
   hasrequestR.   t   reports(    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR?   ?   s     		
	c         C` sz   |  j  j   } | j   | j d  | j |  j  t |  j j j    } | rv | j d j	 d j
 |    n  d S(   sA   Show test function, parameters and the fixtures of the test item.t    i   s    (fixtures used: {0})s   , Ns           (   R   t   get_terminal_writert   linet   writet   _nodeidt   sortedt   _fixtureinfot   name2fixturedefst   keyst   formatt   join(   RA   t   twt   used_fixtures(    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyRK   S   s    
c         C` s   |  j  j j |   d  S(   N(   R2   R1   t   prepare(   RA   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyt   pytest_runtest_setup]   s    c         C` se   y |  j    WnP t k
 r` t j   \ } } } | j } | t _ | t _ | t _ ~   n Xd  S(   N(   t   runtestt	   Exceptiont   syst   exc_infot   tb_nextt	   last_typet
   last_valuet   last_traceback(   RA   R   t   valuet   tb(    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyt   pytest_runtest_call`   s    				c         C` s   |  j  j j |  |  d  S(   N(   R2   R1   t   teardown_exact(   RA   R<   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyt   pytest_runtest_teardownm   s    c         C` s4   |  j  d
 k r0 |  j r d S|  j r) d Sd Sn  d  S(   NRD   RF   t   errort   Et   ERRORt   skippedt   st   SKIPPEDt    (   s   setups   teardown(   s   errorRo   s   ERROR(   s   skippedRr   Rs   (   Rt   Rt   Rt   (   R)   t   failedRq   (   t   report(    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyt   pytest_report_teststatusp   s    		c         K` s~   t  |  | |  } |  j } | j d |  d |  } | rL | j d |  n  t | |  rz | j d |  d | d |  n  | S(   NRA   RE   Rv   t   node(   t   call_runtest_hookR=   t   pytest_runtest_makereportt   pytest_runtest_logreportt   check_interactive_exceptiont   pytest_exception_interact(   RA   R)   RO   t   kwdsRE   t   hookRv   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyRH   ~   s    	c         C` sA   |  j  o@ t | d  p? |  j  j t j  p? |  j  j t j  S(   Nt   wasxfail(   t   excinfoR!   t   errisinstancet   skipRb   t   bdbt   BdbQuit(   RE   Rv   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR|      s    	c         ` s;   d | } t   j |    t     f d   d | S(   Nt   pytest_runtest_c           ` s     d    S(   NRA   (    (    (   R=   RA   R~   (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR      s    R)   (   t   getattrR=   t   CallInfo(   RA   R)   R~   t   hookname(    (   R=   RA   R~   s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyRy      s    
R   c           B` s&   e  Z d  Z d Z d   Z d   Z RS(   s.    Result/Exception info a function invocation. c         C` sj   | |  _  t   |  _ y |   |  _ Wn2 t k
 rG t   |  _   n t   |  _ n Xt   |  _ d  S(   N(   R)   R   t   startt   resultt   KeyboardInterruptt   stopR   R   (   R8   t   funcR)   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR9      s    	c         C` sC   |  j  r" d t |  j  j  } n d |  j f } d |  j | f S(   Ns   exception: %ss
   result: %rs   <CallInfo when=%r %s>(   R   t   strRi   R   R)   (   R8   t   status(    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyt   __repr__   s    	N(   R:   R;   t   __doc__R   R   R9   R   (    (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR      s   	c         C` sh   y |  j  SWnV t k
 rc |  j } d | d d  } d | d | d | | d f |  _  } | SXd  S(   Ns   %s.%s.%st   version_infoi   s   [%s] %s -- Python %s %st   idt   sysplatformt
   executable(   t   _slaveinfocachet   AttributeErrort	   slaveinfo(   Rx   t   dt   verRr   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyt   getslaveinfoline   s    	&t
   BaseReportc           B` s   e  Z d    Z d   Z d   Z e d    Z e d    Z e d    Z e d    Z	 e d    Z
 e d    Z e d	    Z RS(
   c         K` s   |  j  j |  d  S(   N(   t   __dict__t   update(   R8   t   kw(    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR9      s    c         C` s   t  |  d  r( | j t |  j   n  |  j } | d  k rA d  St  | d  r` | j |  n2 y | j |  Wn t k
 r | j d  n Xd  S(   NRx   t
   toterminals   <unprintable longrepr>(   R!   RT   R   Rx   t   longreprR   R   t   UnicodeEncodeError(   R8   t   outR   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR      s    	c         c` s;   x4 |  j  D]) \ } } | j |  r
 | | f Vq
 q
 Wd  S(   N(   t   sectionst
   startswith(   R8   t   prefixt   namet   content(    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyt   get_sections   s    c         C` sD   t  j j d t  } t | _ |  j |  | j j   } | j	   S(   s   
        Read-only property that returns the full string representation
        of ``longrepr``.

        .. versionadded:: 3.0
        t   stringio(
   t   pyt   iot   TerminalWriterR@   RM   t	   hasmarkupR   R   t   getvaluet   strip(   R8   R]   t   exc(    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyt   longreprtext   s
    	c         C` s    d j  d   |  j d  D  S(   sa   Return captured text from stdout, if capturing is enabled

        .. versionadded:: 3.0
        Rt   c         s` s   |  ] \ } } | Vq d  S(   N(    (   t   .0R   R   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pys	   <genexpr>   s    s   Captured stdout(   R\   R   (   R8   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyt	   capstdout   s    c         C` s    d j  d   |  j d  D  S(   sa   Return captured text from stderr, if capturing is enabled

        .. versionadded:: 3.0
        Rt   c         s` s   |  ] \ } } | Vq d  S(   N(    (   R   R   R   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pys	   <genexpr>   s    s   Captured stderr(   R\   R   (   R8   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyt	   capstderr   s    c         C` s   |  j  d k S(   NRI   (   t   outcome(   R   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR      s    c         C` s   |  j  d k S(   NRu   (   R   (   R   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR      s    c         C` s   |  j  d k S(   NRq   (   R   (   R   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR      s    c         C` s   |  j  j d  d S(   Ns   ::i    (   R&   t   split(   R8   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyt   fspath   s    (   R:   R;   R9   R   R   t   propertyR   R   R   RI   Ru   Rq   R   (    (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR      s   			c      	   C` so  | j  } | j | j } t g  |  j D] } | d f ^ q&  } | j } g  } | j sh d } d  }	 n t | t  s d } | }	 n | j	 t
 j  r d } | j   }
 t |
 j  |
 j |
 j f }	 nE d } | j  d k r |  j |  }	 n |  j | d |  j j j }	 x7 |  j D], \ } } } | j d | | f | f  qWt |  j |  j | | |	 | | |  S(   Ni   RI   Ru   Rq   RE   t   styles   Captured %s %s(   R)   R   R   t   dictt   keywordsR   R   t
   isinstanceR   R   R   Rb   t   _getreprcrashR   t   patht   linenot   messaget   repr_failuret   _repr_failure_pyR   R   t   tbstylet   _report_sectionsR"   t
   TestReportR&   R7   (   RA   RE   R)   R   R   R   R   R   R   R   t   rt   rwhenR   R   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyRz      s2    	(				!!R   c           B` s&   e  Z d  Z d d d  Z d   Z RS(   sY    Basic test report object (also used for setup and teardown calls if
    they fail).
    i    c	   
      K` sb   | |  _  | |  _ | |  _ | |  _ | |  _ | |  _ t |  |  _ | |  _ |  j	 j
 |	  d  S(   N(   R&   R7   R   R   R   R)   t   listR   R   R   R   (
   R8   R&   R7   R   R   R   R)   R   R   t   extra(    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR9     s    							c         C` s   d |  j  |  j |  j f S(   Ns"   <TestReport %r when=%r outcome=%r>(   R&   R)   R   (   R8   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR   :  s    (    (   R:   R;   R   R9   R   (    (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR     s   !t   TeardownErrorReportc           B` s   e  Z d  Z d Z d   Z RS(   Ru   RF   c         K` s&   | |  _  g  |  _ |  j j |  d  S(   N(   R   R   R   R   (   R8   R   R   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR9   A  s    		(   R:   R;   R   R)   R9   (    (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR   >  s   c   	      ` s  t    f d   d  } d  } | j s0 d } n d d l m } t f | j   } | j j |  r d }   j | j d  j	 } t
 | j  | j | j f } n< d }   j | j  } t | d	  s t |  } n  | } t   j | | t | d
 d    } | | _ | S(   Nc           ` s   t    j    S(   N(   R   t   collect(    (   t	   collector(    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR   H  s    R   RI   i    (   t   noseRq   RT   Ru   R   R   (   R   R   R   t   _pytestR   t   Skippedt   get_skip_exceptionsR   R   t	   reprcrashR   R   R   R   R   R!   t   CollectErrorReprt   CollectReportR&   R   RE   (	   R   RE   R   R   R   t   skip_exceptionsR   t	   errorinfoR.   (    (   R   s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyt   pytest_make_collect_reportF  s*    			!	R   c           B` s,   e  Z d d   Z e d    Z d   Z RS(   c         K` sM   | |  _  | |  _ | |  _ | p$ g  |  _ t |  |  _ |  j j |  d  S(   N(   R&   R   R   R   R   R   R   R   (   R8   R&   R   R   R   R   R   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR9   a  s    			c         C` s   |  j  d  |  j  f S(   N(   R   R   (   R8   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR7   j  s    c         C` s    d |  j  t |  j  |  j f S(   Ns*   <CollectReport %r lenresult=%s outcome=%r>(   R&   t   lenR   R   (   R8   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR   n  s    (    (   R:   R;   R9   R   R7   R   (    (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR   `  s   R   c           B` s   e  Z d    Z d   Z RS(   c         C` s   | |  _  d  S(   N(   R   (   R8   t   msg(    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR9   s  s    c         C` s   | j  |  j d t d  S(   Nt   red(   RT   R   R@   (   R8   R   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR   u  s    (   R:   R;   R9   R   (    (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR   r  s   	R0   c           B` s_   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d	   Z RS(
   sD    shared state for setting up/tearing down test items or collectors. c         C` s   g  |  _  i  |  _ d  S(   N(   t   stackt   _finalizers(   R8   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR9   z  s    	c         C` sT   | r t  | t  s t  t j j |  s4 t  |  j j | g   j |  d S(   s    attach a finalizer to the given colitem.
        if colitem is None, this will add a finalizer that
        is called at the end of teardown_all().
        N(	   R   t   tuplet   AssertionErrorR   t   builtint   callableR   t
   setdefaultR"   (   R8   t	   finalizert   colitem(    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyt   addfinalizer~  s    c         C` s    |  j  j   } |  j |  d  S(   N(   R   t   popt   _teardown_with_finalization(   R8   R   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyt   _pop_and_teardown  s    c         C` s   |  j  j | d   } d  } xP | rm | j   } y |   Wq t k
 ri | d  k rj t j   } qj q Xq W| r t j j |   n  d  S(   N(	   R   R   R   Rb   Rc   Rd   R   R   t   _reraise(   R8   R   t
   finalizersR   t   fin(    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyt   _callfinalizers  s    	c         C` sq   |  j  |  t | d  r) | j   n  xA |  j D]6 } | d  k s3 | |  j k s3 t | t  s3 t  q3 Wd  S(   NRF   (	   R   R!   RF   R   R   R   R   R   R   (   R8   R   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR     s    c         C` sU   x |  j  r |  j   q Wx$ t |  j  D] } |  j |  q* W|  j sQ t  d  S(   N(   R   R   R   R   R   R   (   R8   R   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR4     s
    c         C` s)   | r | j    p g  } |  j |  d  S(   N(   t	   listchaint   _teardown_towards(   R8   RA   R<   t   needed_collectors(    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyRl     s    c         C` s>   x7 |  j  r9 |  j  | t |  j    k r, Pn  |  j   q Wd  S(   N(   R   R   R   (   R8   R   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR     s    c         C` s   | j    } |  j |  x6 |  j D]+ } t | d  r# t j j | j   q# q# Wx_ | t |  j  D]J } |  j j	 |  y | j
   Wqf t k
 r t j   | _   qf Xqf Wd S(   sn    setup objects along the collector chain to the test-method
            and teardown previously setup objects.t   _prepare_excN(   R   R   R   R!   R   R   R   R   R   R"   RD   Rb   Rc   Rd   (   R8   R   R   t   col(    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR_     s    (   R:   R;   R   R9   R   R   R   R   R4   Rl   R   R_   (    (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR0   x  s   		
						c         C` sx   |  j  } | j d |   | j d |   } | j j d d   } | rt t | |  rt | j d |  d | d |  n  | S(   NR   RE   Rx   Rv   (   R=   t   pytest_collectstartR   R   R   R   R|   R}   (   R   R=   R.   RE   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyt   collect_one_node  s    	t   OutcomeExceptionc           B` s,   e  Z d  Z d e d  Z d   Z e Z RS(   sw    OutcomeException and its subclass instances indicate and
        contain info about test and collection outcomes.
    c         C` s&   t  j |  |  | |  _ | |  _ d  S(   N(   Rb   R9   R   t   pytrace(   R8   R   R   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR9     s    	c         C` sQ   |  j  r@ |  j  } t | t  r< t j j | d d } n  | Sd |  j j f S(   Nt   errorsR'   s   <%s instance>(   R   R   t   bytesR   t   _builtint   _totextt	   __class__R:   (   R8   t   val(    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR     s    		N(   R:   R;   R   R   R@   R9   R   t   __str__(    (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR     s   	R   c           B` s    e  Z d  Z d e e d  Z RS(   t   builtinsc         C` s&   t  j |  d | d | | |  _ d  S(   NR   R   (   R   R9   t   allow_module_level(   R8   R   R   R   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR9     s    N(   R:   R;   R   R@   RM   R9   (    (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR     s   t   Failedc           B` s   e  Z d  Z d Z RS(   s/    raised from an explicit call to pytest.fail() R   (   R:   R;   R   (    (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR     s   t   Exitc           B` s   e  Z d  Z d d  Z RS(   s=    raised for immediate program exits (no tracebacks/summaries)s   unknown reasonc         C` s   | |  _  t j |  |  d  S(   N(   R   R   R9   (   R8   R   (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR9     s    	(   R:   R;   R   R9   (    (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR     s   c         C` s   t  } t |    d S(   s=    exit testing process as if KeyboardInterrupt was triggered. N(   R@   R   (   R   t   __tracebackhide__(    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyt   exit  s    Rt   c         C` s   t  } t d |    d S(   s   skip an executing test with the given message.  Note: it's usually
    better to use the pytest.mark.skipif marker to declare a test to be
    skipped under certain conditions like mismatching platforms or
    dependencies.  See the pytest_skipping plugin for details.
    R   N(   R@   R   (   R   R  (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyR     s    c         C` s   t  } t d |  d |   d S(   s    explicitly fail an currently-executing test with the given Message.

    :arg pytrace: if false the msg represents the full failure information
                  and no python traceback will be reported.
    R   R   N(   R@   R   (   R   R   R  (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyt   fail  s    c      	   C` s[  d d l  } t } t |  d d  t } | j   : | j d  y t |   Wn t k
 ri t } n XWd QX| r t d |  f d t  n  t	 j
 |  } | d k r | St | d d  } | d k	 rWy d d	 l m } Wn* t k
 rt d
 |  f d t  n X| d k s2| |  | |  k  rWt d |  | | f d t  qWn  | S(   s    return imported module if it has at least "minversion" as its
    __version__ attribute.  If no minversion is specified the a skip
    is only triggered if the module can not be imported.
    i    NRt   t   evalt   ignores   could not import %rR   t   __version__(   t   parse_versions\   we have a required version for %r but can not import pkg_resources to parse version strings.s-   module %r has __version__ %r, required is: %r(   t   warningsR@   t   compileRM   t   catch_warningst   simplefiltert
   __import__t   ImportErrorR   Rc   t   modulesR   R   t   pkg_resourcesR  (   t   modnamet
   minversionR  R  t   should_skipt   modt   verattrt   pv(    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyt   importorskip   s6    
$(    (    (3   R   t
   __future__R    R   R   R   Rc   R   R   t   _pytest._code.codeR   R   R   R/   R3   R5   R6   RB   R@   R   R?   RK   R`   Rk   Rm   Rw   RH   R|   Ry   R   R   t   objectR   Rz   R   R   R   R   R   R0   R   Rb   R   R   R   R   R   R  R   R  R  (    (    (    s.   /tmp/pip-build-hU8Cw8/pytest/_pytest/runner.pyt   <module>   sV   						
				
			
@	*	N	
		
	
	