
^Yc           @` s  d  Z  d d l m Z m Z m Z d d l Z d d l m Z m Z m	 Z	 m
 Z
 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 j Z d   Z d   Z d   Z d   Z d	 f  d
     YZ d f  d     YZ e d  Z d   Z d   Z d   Z d S(   st    terminal reporting of the full testing process.

This is a good source for looking at the various reporting hooks.
i    (   t   absolute_importt   divisiont   print_functionN(   t   EXIT_OKt   EXIT_TESTSFAILEDt   EXIT_INTERRUPTEDt   EXIT_USAGEERRORt   EXIT_NOTESTSCOLLECTEDc         C` s  |  j  d d d d } | j d d d d d	 d
 d d d d f | j d d d d d	 d d d d d f | j d d d d	 d d d d d d d | j d d d t d	 d d d d d | j d d  d d d	 d! d t d d" | j d# d d$ d d d	 d% d d& d' d& d( d) d* d+ d, g d d- | j d. d/ d d d t d d0 | j d1 d d2 d d d	 d2 d d& d' d3 d* d& g d d4 d  S(5   Ns   terminal reportingt	   reportingt   aftert   generals   -vs	   --verboset   actiont   countt   destt   verboset   defaulti    t   helps   increase verbosity.s   -qs   --quiett   quiets   decrease verbosity.s   -rt   storet   reportcharst    t   metavart   charss   show extra test summary info as specified by chars (f)ailed, (E)error, (s)skipped, (x)failed, (X)passed, (p)passed, (P)passed with output, (a)all except pP. Warnings are displayed at all times except when --disable-warnings is sets   --disable-warningss   --disable-pytest-warningst   disable_warningst
   store_trues   disable warnings summarys   -ls   --showlocalst
   showlocalss0   show locals in tracebacks (disabled by default).s   --tbt   stylet   tbstylet   autot   choicest   longt   shortt   not   linet   natives6   traceback print mode (auto/long/short/line/native/no).s   --fulltraces   --full-traces-   don't cut any tracebacks (default is to cut).s   --colort   colort   yess$   color terminal output (yes/no/auto).(   t   getgroupt
   _addoptiont   False(   t   parsert   group(    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   pytest_addoption   s2    c         ` s   |  j  j |  j  j 8_ t |  t j    |  j j   d  |  j  j sU |  j  j	 r}   f d   } |  j
 j j d |  n  d  S(   Nt   terminalreporterc         ` s-   d j  t t |   }   j d |  d  S(   Nt    s   [traceconfig] (   t   joint   mapt   strt
   write_line(   t   tagst   argst   msg(   t   reporter(    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   mywriter7   s    s   pytest:config(   t   optionR   R   t   TerminalReportert   syst   stdoutt   pluginmanagert   registert   debugt   traceconfigt   tracet   roott   setprocessor(   t   configR5   (    (   R4   s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   pytest_configure2   s    c         C` s   d } |  j  j } |  j  j r8 d | k r8 | d 7} n- |  j  j re d | k re | j d d  } n  | r xK | D]@ } | | k r | d k r | | 7} qr | d k rr d } qr qr Wn  | S(   NR   t   wt   at   fEsxXw(   R6   R   R   t   replace(   RA   t
   reportoptsR   t   char(    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   getreportopt<   s    c         C` sg   |  j  r d } n< |  j r$ d } n* |  j rN d } |  j d k rN d } qN n  |  j | |  j j   f S(   Nt   .t   st   Ft   callt   f(   t   passedt   skippedt   failedt   whent   outcomet   upper(   t   reportt   letter(    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   pytest_report_teststatusK   s    					t   WarningReportc           B` s&   e  Z d  Z d d d  Z d   Z RS(   sZ   
    Simple structure to hold warnings information captured by ``pytest_logwarning``.
    c         C` s(   | |  _  | |  _ | |  _ | |  _ d S(   sI  
        :param code: unused
        :param str message: user friendly message about the warning
        :param str|None nodeid: node id that generated the warning (see ``get_location``).
        :param tuple|py.path.local fslocation:
            file system location of the source of the warning (see ``get_location``).
        N(   t   codet   messaget   nodeidt
   fslocation(   t   selfRY   RZ   R[   R\   (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   __init__[   s    			c         C` s   |  j  r |  j  S|  j r t |  j t  r t |  j  d k r |  j d  \ } } t j j |  j | j	  } d | | f St
 |  j  Sn  d S(   sn   
        Returns the more user-friendly information about the location
        of a warning, or None.
        i   s   %s:%sN(   R[   R\   t
   isinstancet   tuplet   lent   pyt   patht   localt   reltot   invocation_dirR/   t   None(   R]   RA   t   filenamet   linenumt   relpath(    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   get_locationh   s    		'N(   t   __name__t
   __module__t   __doc__Rg   R^   Rk   (    (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyRX   W   s   R7   c           B` s  e  Z d- d   Z d   Z d   Z d d  Z d   Z d   Z d   Z	 d   Z
 d- d	  Z d
 d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z e d  Z d   Z e j d e  d    Z d   Z d   Z d   Z e j d e  d    Z  d   Z! d   Z" d    Z# d!   Z$ d"   Z% d#   Z& d$   Z' d%   Z( d&   Z) d'   Z* d(   Z+ d)   Z, d*   Z- d+   Z. d,   Z/ RS(.   c         C` s   d d  l  } | |  _ |  j j j |  _ |  j d k |  _ |  j d k |  _ |  j d k |  _ d |  _ i  |  _	 t
 j j   |  _ | d  k r t j } n  | j j | |  |  _ |  _ d  |  _ t |  |  _ |  j j |  _ | j   |  _ d  S(   Ni    (   t   _pytest.configRA   R6   R   t	   verbosityt
   showheadert
   showfspatht   showlongtestinfot   _numcollectedt   statsRb   Rc   Rd   t   startdirRg   R8   R9   t   create_terminal_writert   _twt   writert   currentfspathRI   R   t	   hasmarkupt   isatty(   R]   RA   t   filet   _pytest(    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyR^   z   s"    				c         C` s-   i d d 6d d 6j  | |  } | |  j k S(   Nt   xt   xfailedRK   RP   (   t   getR   (   R]   RH   (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   hasopt   s     c         C` s   |  j  j j | j d  d  } | |  j k rp | |  _ |  j j |  } |  j j   |  j j	 | d  n  |  j j	 |  d  S(   Ns   ::i    R,   (
   RA   t   rootdirR-   t   splitRz   Rv   t   bestrelpathRx   R!   t   write(   R]   R[   t   rest   fspath(    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   write_fspath_result   s    "	R   c         K` sa   |  j  | k r8 |  j j   | |  _  |  j j |  n  | r] |  j j | |  d |  _  n  d  S(   Ni(   Rz   Rx   R!   R   (   R]   t   prefixt   extrat   kwargs(    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   write_ensure_prefix   s    	c         C` s&   |  j  r" |  j j   d  |  _  n  d  S(   N(   Rz   Rx   R!   Rg   (   R]   (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   ensure_newline   s    	c         K` s   |  j  j | |  d  S(   N(   Rx   R   (   R]   t   contentt   markup(    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyR      s    c         K` sN   t  j j |  s- t  j j | d d } n  |  j   |  j j | |  d  S(   Nt   errorsRF   (   Rb   t   builtint   _istextt   textR   Rx   R!   (   R]   R!   R   (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyR0      s    
c         K` s'   t  |  } |  j j d | |  d  S(   Ns   (   R/   Rx   R   (   R]   R!   R   (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   rewrite   s    c         K` s$   |  j    |  j j | | |  d  S(   N(   R   Rx   t   sep(   R]   R   t   titleR   (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt	   write_sep   s    
t   =c         K` s   |  j  j | | |  d  S(   N(   Rx   R   (   R]   R   R   t   kw(    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   section   s    c         K` s   |  j  j | |  d  S(   N(   Rx   R!   (   R]   R3   R   (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyR!      s    c         C` s;   x4 t  j j |  j d  D] } |  j d |  q Wd S(   Ns   
s   INTERNALERROR> i   (   Rb   R   R   R   R0   (   R]   t   excreprR!   (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   pytest_internalerror   s    "c      	   C` sG   |  j  j d g   } t d | d | d | d |  } | j |  d  S(   Nt   warningsRY   R\   RZ   R[   (   Ru   t
   setdefaultRX   t   append(   R]   RY   R\   RZ   R[   R   t   warning(    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   pytest_logwarning   s    c         C` s0   |  j  j j r, d | f } |  j |  n  d  S(   Ns   PLUGIN registered: %s(   RA   R6   R=   R0   (   R]   t   pluginR3   (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   pytest_plugin_registered   s    c         C` s    |  j  j d g   j |  d  S(   Nt
   deselected(   Ru   R   t   extend(   R]   t   items(    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   pytest_deselected   s    c         C` sa   |  j  r. |  j | |  } |  j | d  n/ |  j r] | j d  d } |  j | d  n  d  S(   NR   s   ::i    (   Rs   t   _locationlineR   Rr   R   R   (   R]   R[   t   locationR!   t   fsid(    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   pytest_runtest_logstart   s    		c   	      C` s  | } |  j  j j d |  } | \ } } } |  j j | g   j |  t |  _ | rd | rd d  S|  j d k r t	 | d  r |  j
 r |  j | j |  q|  j j |  nt | t  r | \ } } nK | j r i t d 6} n2 | j ri t d 6} n | j ri t d 6} n  |  j | j | j  } t	 | d  s[|  j | | |  ni |  j   t	 | d  r|  j j d | j j j  n  |  j j | |  |  j j d |  d	 |  _ d  S(
   NRU   i    t   nodet   greent   redt   yellows   [%s] R,   i(   RA   t   hookRW   Ru   R   R   t   Truet
   _tests_ranRp   t   hasattrRr   R   R[   Rx   R   R_   R`   RO   RQ   RP   R   R   R   R   R   t   gatewayt   idRz   (	   R]   RU   t   repR   t   catRV   t   wordR   R!   (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   pytest_runtest_logreport   s8    				
 c         C` s9   |  j  r5 |  j j j d k r5 |  j d d t n  d  S(   Ni   s   collecting ... t   bold(   R|   RA   R6   R   R   R   (   R]   (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   pytest_collection  s    c         C` s   | j  r( |  j j d g   j |  n( | j rP |  j j d g   j |  n  g  | j D] } t | t j  rZ | ^ qZ } |  j	 t
 |  7_	 |  j r |  j   n  d  S(   Nt   errorRP   (   RQ   Ru   R   R   RP   t   resultR_   t   pytestt   ItemRt   Ra   R|   t   report_collect(   R]   RU   R   R   (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   pytest_collectreport  s    		.	c         C` s  |  j  j j d k  r d  St |  j j d g    } t |  j j d g    } | r^ d } n d } | t |  j  d |  j d k r d n d	 7} | r | d
 | 7} n  | r | d | 7} n  |  j r | r | d 7} n  |  j	 | d t
 n |  j |  d  S(   Ni    R   RP   s
   collected s   collecting s    itemi   R   RK   s    / %d errorss    / %d skippeds    
R   (   RA   R6   R   Ra   Ru   R   R/   Rt   R|   R   R   R0   (   R]   t   finalR   RP   R!   (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyR     s"    	0	c         C` s   |  j  t  d  S(   N(   R   R   (   R]   (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   pytest_collection_modifyitems)  s    t   trylastc         C` sp  t  j    |  _ |  j s d  S|  j d d d t t j   } d t j | f } t t d  r d j	 t
 t t j d    } | d | t j d f 7} n  | d	 t j t j t j f 7} |  j d
 k s |  j j j s t |  j j d d   r| d t t j  7} n  |  j |  |  j j j d |  j d |  j  } | j   x! t |  D] } |  j |  qUWd  S(   NR   s   test session startsR   s   platform %s -- Python %st   pypy_version_infoRJ   i   s   [pypy-%s-%s]s   , pytest-%s, py-%s, pluggy-%si    t   pastebins    -- RA   Rv   (   t   timet   _sessionstarttimeRq   R   R   t   platformt   python_versionR8   R   R-   R.   R/   R   R   t   __version__Rb   t   pluggyRp   RA   R6   R<   t   getattrRg   t
   executableR0   R   t   pytest_report_headerRv   t   reverset   flatten(   R]   t   sessiont   verinfoR3   t   linesR!   (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   pytest_sessionstart,  s(    	
c         C` s}   d } | j  r+ d | j j | j   } n  d | j | f g } | j j   } | ry | j d d j t |    n  | S(   NR   R,   s   rootdir: %s, inifile:%ss   plugins: %ss   , (   t   inifileR   R   R:   t   list_plugin_distinfoR   R-   t   _plugin_nameversions(   R]   RA   R   R   t
   plugininfo(    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyR   C  s    	c         C` s   |  j  j j ry |  j | j  |  j j d  ru |  j j d d  x* |  j j d  D] } | j	 |  j  qW Wd Sd S|  j
 s d  Sd  S(   NRQ   t   !s   collection failuresi   i    (   RA   R6   t   collectonlyt   _printcollecteditemsR   Ru   R   Rx   R   t
   toterminalRq   (   R]   R   R   (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   pytest_collection_finishP  s    	c         C` s  |  j  j j d k  r |  j  j j d k  r i  } xA | D]9 } | j j d d  d } | j | d  d | | <q7 Wxy t | j    D]& \ } } |  j j	 d | | f  q Wn< x9 | D]1 } | j } | j
 d d  } |  j j	 |  q Wd  Sg  } d } x | D] } | j   d }	 x. | rM| |	 t |   k r@Pn  | j   q WxS |	 t |  D]A }
 | j |
  t |  d d } |  j j	 d	 | |
 f  q_WqWd  S(
   Ni    is   ::i   s   %s: %ds   ::()::R   s     s   %s%s(   RA   R6   R   R[   R   R   t   sortedR   Rx   R!   RF   t	   listchainRa   t   popR   (   R]   R   t   countst   itemt   nameR   R[   t   stackt   indentt   needed_collectorst   col(    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyR   ^  s2    !		t   hookwrapperc         c` s   d  V} | j    |  j j d  t t t t t f } | | k r |  j j	 j
 d |  d |  |  j   |  j   |  j   |  j   n  | t k r |  j   |  ` n  |  j   |  j   d  S(   NR   R+   t
   exitstatus(   t
   get_resultRx   R!   R   R   R   R   R   RA   R   t   pytest_terminal_summaryt   summary_errorst   summary_failurest   summary_warningst   summary_passest   _report_keyboardinterruptt   _keyboardinterrupt_memot   summary_deselectedt   summary_stats(   R]   R   RS   t   summary_exit_codes(    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   pytest_sessionfinish  s"    
	



	
c         C` s   | j  d t  |  _ d  S(   Nt   funcargs(   t   getreprR   R   (   R]   t   excinfo(    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   pytest_keyboard_interrupt  s    c         C` s    t  |  d  r |  j   n  d  S(   NR   (   R   R   (   R]   (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   pytest_unconfigure  s    c         C` s   |  j  } | j j } |  j d |  d | k r |  j j j rS | j |  j  q |  j j	 d d t
 | j j |  j  n  d  S(   NR   t   KeyboardInterrupts=   to show a full traceback on KeyboardInterrupt use --fulltraceR   (   R   t	   reprcrashRZ   R   RA   R6   t	   fulltraceR   Rx   R!   R   (   R]   R   R3   (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyR     s    	c         ` s      f d   } | ru | |  j  d d  } | j d  d | j  d d  k r{ | d  j j |  7} q{ n d	 } | d
 S(   Nc         ` s{    j  j |   }   rw | j    rw | t     }   j d  } | d j d d  | d <| d j |  7} n  | S(   Nt   [i    RJ   s   ::(   RA   t   cwd_relative_nodeidt   endswithRa   R   RF   R-   (   R[   R!   t   l(   t   domainR]   (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   mkrel  s    s   ::()R   s   ::i    s   \t   /s    <- s
   [location]R,   (   RF   R   Rv   R   (   R]   R[   R   t   linenoR  R  R   (    (   R  R]   s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyR     s    
% c         C` s-   t  | d  r% | j \ } } } | Sd Sd  S(   NR   s   test session(   R   R   (   R]   R   R   R  R  (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   _getfailureheadline  s    c         C` sV   y t  | j j  SWn; t k
 rQ y t  | j  d  SWqR t k
 rM d SXn Xd  S(   Ni2   R   (   R/   t   longreprR   t   AttributeError(   R]   R   (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   _getcrashline  s    c         C` sI   g  } x< |  j  j | g   D]% } t | d  s | j |  q q W| S(   Nt	   _pdbshown(   Ru   R   R   R   (   R]   R   R  R   (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt
   getreports  s
    c         ` s    j  d  r  j j d  } | s+ d  St j | d   f d   }   j d d d t d t x | D]~ \ } }   j j	 t
 |  p d	  xF | D]> } | j j   } d
 j d   | D  }   j j	 |  q W  j j	   ql W  j j	 d  n  d  S(   NRC   R   t   keyc         ` s   |  j    j  S(   N(   Rk   RA   (   t   wr(   R]   (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   <lambda>  s    R   s   warnings summaryR   R   s   <undetermined location>s   
c         s` s   |  ] } d  | Vq d S(   s     N(    (   t   .0R   (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pys	   <genexpr>  s    s6   -- Docs: http://doc.pytest.org/en/latest/warnings.html(   R   Ru   R   t	   itertoolst   groupbyR   R   R'   Rx   R!   R/   RZ   t
   splitlinesR-   (   R]   t   all_warningst   groupedR   R   RC   R   t   indented(    (   R]   s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyR     s    c         C` s   |  j  j j d k r |  j d  r |  j d  } | s= d  S|  j d d  x= | D]2 } |  j |  } |  j d |  |  j |  qT Wq n  d  S(   NR    t   PRO   R   t   PASSESt   _(   RA   R6   R   R   R  R   R  t   _outrep_summary(   R]   t   reportsR   R3   (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyR     s    c         C` sm   xf | j  D][ \ } } d | k r
 |  j j d |  | d d k rR | d  } n  |  j j |  q
 q
 Wd  S(   Nt   teardownt   -is   
(   t   sectionsRx   R   R!   (   R]   R   t   secnameR   (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   print_teardown_sections  s    c         C` s  |  j  j j d k r|  j d  } | s. d  S|  j d d  x | D] } |  j  j j d k r |  j |  } |  j |  qE |  j |  } i t d 6t d 6} |  j d | |  |  j	 |  xH |  j d	  D]7 } | j
 | j
 k r | j d
 k r |  j |  q q WqE Wn  d  S(   NR    RQ   R   t   FAILURESR!   R   R   R  R   R  (   RA   R6   R   R  R   R  R0   R  R   R  R[   RR   R!  (   R]   R  R   R!   R3   R   RU   (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyR     s     !c         C` s   |  j  j j d k r |  j d  } | s. d  S|  j d d  x |  j d D] } |  j |  } t | d  s} d | } n8 | j d k r d | } n | j d	 k r d
 | } n  |  j d |  |  j	 |  qL Wn  d  S(   NR    R   R   t   ERRORSRR   s   ERROR collecting t   setups   ERROR at setup of R  s   ERROR at teardown of R  (
   RA   R6   R   R  R   Ru   R  R   RR   R  (   R]   R  R   R3   (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyR     s    c         C` sn   | j  |  j  xW | j D]L \ } } |  j j d |  | d d k rV | d  } n  |  j j |  q Wd  S(   NR  is   
(   R   Rx   R  R   R!   (   R]   R   R   R   (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyR    s    c         C` s   t  j    |  j } t |  j  \ } } d | | f } i t | 6t d 6} |  j d k rq |  j d | |  n  |  j d k r |  j | |  n  d  S(   Ns   %s in %.2f secondsR   i    R   i(   R   R   t   build_summary_stats_lineRu   R   Rp   R   R0   (   R]   t   session_durationR!   R#   R3   R   (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyR   '  s    c         C` s=   d |  j  k r9 |  j d d t |  j  d  d t n  d  S(   NR   R   s   %d tests deselectedR   (   Ru   R   Ra   R   (   R]   (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyR   2  s    N(0   Rl   Rm   Rg   R^   R   R   R   R   R   R0   R   R   R   R!   R   R   R   R   R   R   R   R   R'   R   R   R   t   hookimplR   R   R   R   R   R   R   R   R   R   R  R  R  R   R   R!  R   R   R  R   R   (    (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyR7   y   sR   														
	$						!															c         C` sI   |  d  k r t j }  n  y d |  SWn t t f k
 rD t |   SXd  S(   Ns   %s.%s.%s-%s-%s(   Rg   R8   t   version_infot	   TypeErrort
   ValueErrorR/   (   t   v(    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   repr_pythonversion7  s    c         c` sN   xG |  D]? } t  | t t f  rA x! t |  D] } | Vq/ Wq | Vq Wd  S(   N(   R_   t   listR`   R   (   R  R   t   y(    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyR   ?  s
    c         C` s"  d j    } t } x? |  j   D]1 } | | k r | rP | j |  t } qP q q Wg  } xF | D]> } |  j | d   } | ra | j d t |  | f  qa qa W| r d j |  } n d } d |  k s d |  k r d } n6 d |  k s | r d	 } n d
 |  k rd } n d	 } | | f S(   Ns?   failed passed skipped deselected xfailed xpassed warnings errors   %d %ss   , s   no tests ranRQ   R   R   R   R   RO   R   (	   R   R'   t   keysR   R   R   Rg   Ra   R-   (   Ru   R/  t   unknown_key_seenR  t   partst   valR!   R#   (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyR%  G  s.    $			c         C` sk   g  } x^ |  D]V \ } } d j  d |  } | j d  rG | d } n  | | k r | j |  q q W| S(   Ns"   {dist.project_name}-{dist.version}t   dists   pytest-i   (   t   formatt
   startswithR   (   R   R  R   R3  R   (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyR   g  s    (   Rn   t
   __future__R    R   R   R  t   _pytest.mainR   R   R   R   R   R   Rb   R8   R   R   t   _pytest._pluggyt   _pluggyR   R*   RB   RI   RW   RX   R7   Rg   R,  R   R%  R   (    (    (    s0   /tmp/pip-build-hU8Cw8/pytest/_pytest/terminal.pyt   <module>   s(   (		
		" 		 