ó
ū^Yc           @` s   d  d l  m Z m Z m Z d  d l Z d  d l Z d   Z e j d e  d    Z	 d   Z
 d   Z e j d e  d	    Z d S(
   i    (   t   absolute_importt   divisiont   print_functionNc         C` sK   |  j  d  } | j d d d d d d | j d d	 d d d d
 d  S(   Nt   debugconfigs   --setuponlys   --setup-onlyt   actiont
   store_truet   helps*   only setup fixtures, do not execute tests.s   --setupshows   --setup-shows-   show setup of fixtures while executing tests.(   t   getgroupt	   addoption(   t   parsert   group(    (    s1   /tmp/pip-build-hU8Cw8/pytest/_pytest/setuponly.pyt   pytest_addoption   s
    t   hookwrapperc         c` s   d  V| j  } | j j r t | d  r~ |  j ro t |  j  rY |  j | j  |  _ q{ |  j | j |  _ q~ | j |  _ n  t	 |  d  n  d  S(   Nt   paramt   SETUP(
   t   configt   optiont	   setupshowt   hasattrt   idst   callableR   t   cached_paramt   param_indext   _show_fixture_action(   t
   fixturedeft   requestR   (    (    s1   /tmp/pip-build-hU8Cw8/pytest/_pytest/setuponly.pyt   pytest_fixture_setup   s    		c         C` sV   t  |  d  rR |  j j } | j j rR t |  d  t  |  d  rO |  ` qO qR n  d  S(   Nt   cached_resultt   TEARDOWNR   (   R   t   _fixturemanagerR   R   R   R   R   (   R   R   (    (    s1   /tmp/pip-build-hU8Cw8/pytest/_pytest/setuponly.pyt   pytest_fixture_post_finalizer"   s    c         C` sS  |  j  j } | j j d  } | r9 | j   \ } } n  | j   } | j   | j d |  j  | j d j	 d | j
 d  d |  j d j   d	 |  j   | d
 k rņ t d   |  j D  } | rņ | j d j	 d j |    qņ n  t |  d  r| j d j	 |  j   n  | rO| j   t j j |  t j j |  n  d  S(   Nt   capturemanagert    i   s   {step} {scope} {fixture}t   stepi   t   scopei    t   fixtureR   c         s` s!   |  ] } | d  k r | Vq d S(   R   N(    (   t   .0t   arg(    (    s1   /tmp/pip-build-hU8Cw8/pytest/_pytest/setuponly.pys	   <genexpr>:   s    s    (fixtures used: {0})s   , R   s   [{0}]s     (   R   R   t   pluginmanagert	   getplugint   suspendcapturet   get_terminal_writert   linet   writet   scopenumt   formatt   ljustR"   t   uppert   argnamet   sortedt   argnamest   joinR   R   t   resumecapturet   syst   stdoutt   stderr(   R   t   msgR   t   capmant   outt   errt   twt   deps(    (    s1   /tmp/pip-build-hU8Cw8/pytest/_pytest/setuponly.pyR   +   s*    
%
t   tryfirstc         C` s   |  j  j r t |  j  _ n  d  S(   N(   R   t	   setuponlyt   TrueR   (   R   (    (    s1   /tmp/pip-build-hU8Cw8/pytest/_pytest/setuponly.pyt   pytest_cmdline_mainG   s    (   t
   __future__R    R   R   t   pytestR5   R   t   hookimplR@   R   R   R   RA   (    (    (    s1   /tmp/pip-build-hU8Cw8/pytest/_pytest/setuponly.pyt   <module>   s   				