ó
:îÜW   c           @   s´  d  d l  Z d  d l j j Z d  d l Z d  d l Z d  d l m	 Z	 m
 Z
 m Z d  d l m Z d  d l m Z d „  Z d „  Z i d dR g f d	 6d
 dS g f d 6d dT dU g f d 6d dV g f d 6d dW g f d 6d dX dY g f d 6d g  f d 6d
 dZ g f d 6d d[ g f d 6d g  f d 6d  d\ g f d! 6d" d] g f d% 6d& d^ g f d( 6d) d_ g f d+ 6d, d` g f d. 6d/ da g f d1 6Z d2 „  Z d3 „  Z d4 „  Z d5 „  Z d6 „  Z d7 „  Z d8 „  Z d9 „  Z e j j j d: d; g ƒ d< „  ƒ Z d= „  Z  d> „  Z! d? „  Z" d@ „  Z# dA „  Z$ dB „  Z% dC „  Z& dD „  Z' dE „  Z( dF „  Z) dG „  Z* dH „  Z+ dI „  Z, dJ „  Z- dK „  Z. dL „  Z/ e j j0 d: dM dN dO dP g ƒ dQ „  ƒ Z1 d S(b   iÿÿÿÿN(   t	   IniConfigt
   ParseErrort   __all__(   t   iscommentline(   t   dedentc         C   sÕ   d |  j  k rY x¿ t j ƒ  D]6 \ } \ } } |  j d | d i | d 6| d 6ƒ q Wnx t |  j d ƒ rÑ |  j j j } t | j ƒ  Œ  \ } } t	 | Œ  } x0 | D]% } |  j d t
 t | | ƒ ƒ ƒ q¥ Wn  d  S(   Nt   inputt   idt   funcargst   expectedt   multi(   t   funcargnamest   check_tokenst   itemst   addcallt   hasattrt   functionR	   t   kwargst   zipt   cartesian_productt   dict(   t   metafunct   nameR   R   R   t   namest   valuest   p(    (    s<   /home/ronny/Projects/pytest-dev/py/testing/test_iniconfig.pyt   pytest_generate_tests   s    c         g   se   | s" xX |  D] } | f Vq Wn? x< |  D]4 } x+ t  | d | d Œ D] } | f | VqG Wq) Wd  S(   Ni    i   (   R   (   t   Lt   listst   xt   y(    (    s<   /home/ronny/Projects/pytest-dev/py/testing/test_iniconfig.pyR      s    s	   [section]i    t   sections	   value = 1t   valuet   1s   [section]
value=1i   s   value in sections   names =
 Alice
 BobR   s	   Alice
Bobs   value with continuations   names = Alice
        Bobs   value with aligned continuations   [section]

value=1i   s
   blank lines	   # commentt   comments   comment on values   [section] #comments   comment on sections	   ; commentt   comment2s   [section] ;comments   comment2 on sections   name = value []R   s   value []s   pseudo section syntax in values   value = x = 3s   x = 3s   assignment in values   name: yR   s   use of colon for name-valuess	   value:y=5s   y=5s   use of colon without spaces   value=xyz:5s   xyz:5s   equality gets precedencec         C   s.   t  j t ƒ } d | _ | j |  j t ƒ ƒ S(   Nt   sample(   t   objectt   __new__R    t   patht   _parset
   splitlinest   True(   R   t   ini(    (    s<   /home/ronny/Projects/pytest-dev/py/testing/test_iniconfig.pyt   parsef   s    	c         C   s   t  j j t t |  ƒ S(   N(   t   pyt   testt   raisesR   R+   (   R   (    (    s<   /home/ronny/Projects/pytest-dev/py/testing/test_iniconfig.pyt   parse_a_errorl   s    c         C   sä   t  |  ƒ } | | k } | sÚ t j d
 | f d | | f ƒ i d t j ƒ  k s` t j | ƒ ro t j | ƒ n d d 6d t j ƒ  k s— t j | ƒ r¦ t j | ƒ n d d 6} d i | d	 6} t t j | ƒ ƒ ‚ n  d  } d  S(   Ns   ==s   %(py0)s == %(py2)st   parsedt   py0R   t   py2t    s   assert %(py4)st   py4(   s   ==(   s   %(py0)s == %(py2)ss   assert %(py4)s(
   R+   t
   @pytest_art   _call_reprcomparet   @py_builtinst   localst   _should_repr_global_namet	   _safereprt   AssertionErrort   _format_explanationt   None(   R   R   R0   t   @py_assert1t   @py_format3t   @py_format5(    (    s<   /home/ronny/Projects/pytest-dev/py/testing/test_iniconfig.pyt   test_tokenizeo   s      “   c          C   s  t  d ƒ }  |  } | sr d	 i d t j ƒ  k s@ t j |  ƒ rO t j |  ƒ n d d 6} t t j | ƒ ƒ ‚ n  d  } t	 d d ƒ } | j
 } | } | s
d d i d t j ƒ  k sÈ t j | ƒ r× t j | ƒ n d d 6t j | ƒ d 6} t t j | ƒ ƒ ‚ n  d  } } d  S(
   NR3   s   assert not %(py0)sR0   R1   R#   s0   assert not %(py2)s
{%(py2)s = %(py0)s.sections
}R*   R2   s   assert not %(py0)s(   R+   R7   R8   R5   R9   R:   R;   R<   R=   R    t   sections(   R0   R>   t   @py_format2R*   t   @py_assert3t   @py_format4(    (    s<   /home/ronny/Projects/pytest-dev/py/testing/test_iniconfig.pyt   test_parse_emptys   s      A  	   U  c          C   s$  t  d d d ƒ }  t |  ƒ } d } | | k } | st j d | f d | | f ƒ i d t j ƒ  k sx t j t ƒ r‡ t j t ƒ n d d 6d	 t j ƒ  k s¯ t j |  ƒ r¾ t j |  ƒ n d	 d
 6t j | ƒ d 6t j | ƒ d 6} d i | d 6} t t j	 | ƒ ƒ ‚ n  d  } } } d  S(   Nt   filenamei    t   hellos   filename:1: hellos   ==s0   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)st   strR1   t   et   py1t   py3t   py6R3   s   assert %(py8)st   py8(   s   ==(   s0   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)ss   assert %(py8)s(   R   RI   R5   R6   R7   R8   R9   R:   R;   R<   R=   (   RJ   t   @py_assert2t   @py_assert5t   @py_assert4t   @py_format7t   @py_format9(    (    s<   /home/ronny/Projects/pytest-dev/py/testing/test_iniconfig.pyt   test_ParseErrory   s        ³   c          C   s  t  d ƒ }  |  j } | j } d } | | k } | së t j d | f d | | f ƒ i d t j ƒ  k sx t j |  ƒ r‡ t j |  ƒ n d d 6t j | ƒ d 6t j | ƒ d 6t j | ƒ d	 6} d i | d 6} t	 t j
 | ƒ ƒ ‚ n  d  } } } } d  S(   Ns    Fooi    s   ==sI   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.value
}.lineno
} == %(py7)st   excinfoR1   R2   R4   t   py7R3   s   assert %(py9)st   py9(   s   ==(   sI   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.value
}.lineno
} == %(py7)ss   assert %(py9)s(   R/   R   t   linenoR5   R6   R7   R8   R9   R:   R;   R<   R=   (   RU   R>   RD   t   @py_assert6RP   t   @py_format8t   @py_format10(    (    s<   /home/ronny/Projects/pytest-dev/py/testing/test_iniconfig.pyt(   test_continuation_needs_perceeding_token}   s    	 	    Œ   c          C   s  t  d ƒ }  |  j } | j } d } | | k } | së t j d | f d | | f ƒ i d t j ƒ  k sx t j |  ƒ r‡ t j |  ƒ n d d 6t j | ƒ d 6t j | ƒ d 6t j | ƒ d	 6} d i | d 6} t	 t j
 | ƒ ƒ ‚ n  d  } } } } d  S(   Ns   [section]
 Fooi   s   ==sI   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.value
}.lineno
} == %(py7)sRU   R1   R2   R4   RV   R3   s   assert %(py9)sRW   (   s   ==(   sI   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.value
}.lineno
} == %(py7)ss   assert %(py9)s(   R/   R   RX   R5   R6   R7   R8   R9   R:   R;   R<   R=   (   RU   R>   RD   RY   RP   RZ   R[   (    (    s<   /home/ronny/Projects/pytest-dev/py/testing/test_iniconfig.pyt'   test_continuation_cant_be_after_section   s    	 	    Œ   c          C   s   t  d ƒ }  d  S(   Ns   [](   R/   (   RU   (    (    s<   /home/ronny/Projects/pytest-dev/py/testing/test_iniconfig.pyt   test_section_cant_be_empty…   s    t   lines   !!c         C   s   t  |  ƒ d  S(   N(   R/   (   R_   (    (    s<   /home/ronny/Projects/pytest-dev/py/testing/test_iniconfig.pyt   test_error_on_weird_linesˆ   s    c   	      C   s¨  |  d } | j  d ƒ t d | ƒ } | j } t | ƒ } d g } | | k } | sBt j d | f d | | f ƒ i d t j ƒ  k s˜ t j t ƒ r§ t j	 t ƒ n d d 6d	 t j ƒ  k sÏ t j | ƒ rÞ t j	 | ƒ n d	 d
 6t j	 | ƒ d 6t j	 | ƒ d 6t j	 | ƒ d 6} d i | d 6} t
 t j | ƒ ƒ ‚ n  d  } } } } t | d ƒ } | j } t | ƒ } d g } | | k } | st j d | f d | | f ƒ i d t j ƒ  k sÕt j t ƒ rät j	 t ƒ n d d 6d	 t j ƒ  k st j | ƒ rt j	 | ƒ n d	 d
 6t j	 | ƒ d 6t j	 | ƒ d 6t j	 | ƒ d 6} d i | d 6} t
 t j | ƒ ƒ ‚ n  d  } } } } t j j t d ƒ d  S(   Ns   test.txts   [metadata]
name=1R&   t   metadatas   ==sN   %(py5)s
{%(py5)s = %(py0)s(%(py3)s
{%(py3)s = %(py1)s.sections
})
} == %(py8)st   listR1   t   configRK   RN   RL   t   py5R3   s   assert %(py10)st   py10s   [diff]t   diffs   IniConfig(data=path.read())(   s   ==(   sN   %(py5)s
{%(py5)s = %(py0)s(%(py3)s
{%(py3)s = %(py1)s.sections
})
} == %(py8)ss   assert %(py10)s(   s   ==(   sN   %(py5)s
{%(py5)s = %(py0)s(%(py3)s
{%(py3)s = %(py1)s.sections
})
} == %(py8)ss   assert %(py10)s(   t   writeR    RB   Rb   R5   R6   R7   R8   R9   R:   R;   R<   R=   R,   R-   R.   t	   TypeError(	   t   tmpdirR&   Rc   RO   RQ   t   @py_assert7RY   RS   t   @py_format11(    (    s<   /home/ronny/Projects/pytest-dev/py/testing/test_iniconfig.pyt   test_iniconfig_from_fileŽ   s.    
	  	   Ã   	  	   Ã   c         C   s
  t  j j t d ƒ } | j } | j } d } | | k } | sô t j d | f d | | f ƒ i d t j	 ƒ  k s t j
 | ƒ r t j | ƒ n d d 6t j | ƒ d 6t j | ƒ d 6t j | ƒ d	 6} d i | d 6} t t j | ƒ ƒ ‚ n  d  } } } } d  S(   Ns+   
        IniConfig("x", data='name=1')
    s   no section header defineds   ==sF   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.value
}.msg
} == %(py7)sRU   R1   R2   R4   RV   R3   s   assert %(py9)sRW   (   s   ==(   sF   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.value
}.msg
} == %(py7)ss   assert %(py9)s(   R,   R-   R.   R   R   t   msgR5   R6   R7   R8   R9   R:   R;   R<   R=   (   Ri   RU   R>   RD   RY   RP   RZ   R[   (    (    s<   /home/ronny/Projects/pytest-dev/py/testing/test_iniconfig.pyt   test_iniconfig_section_first˜   s    		 	    Œ   c          C   sD  t  j j t d ƒ }  d } |  j } t | ƒ } | | k } | s.t j d | f d | | f ƒ i t j | ƒ d 6t j | ƒ d 6d t	 j
 ƒ  k s¤ t j t ƒ r³ t j t ƒ n d d 6d	 t	 j
 ƒ  k sÛ t j |  ƒ rê t j |  ƒ n d	 d
 6t j | ƒ d 6} d i | d 6} t t j | ƒ ƒ ‚ n  d  } } } } d  S(   Ns9   
        IniConfig("x", data='[section]\n[section]')
    s   duplicate sectiont   insK   %(py1)s in %(py8)s
{%(py8)s = %(py3)s(%(py6)s
{%(py6)s = %(py4)s.value
})
}RN   RK   RI   RL   RU   R4   RM   R3   s   assert %(py10)sRe   (   Ro   (   sK   %(py1)s in %(py8)s
{%(py8)s = %(py3)s(%(py6)s
{%(py6)s = %(py4)s.value
})
}s   assert %(py10)s(   R,   R-   R.   R   R   RI   R5   R6   R:   R7   R8   R9   R;   R<   R=   (   RU   t   @py_assert0RP   Rj   RO   RS   Rk   (    (    s<   /home/ronny/Projects/pytest-dev/py/testing/test_iniconfig.pyt%   test_iniconig_section_duplicate_failsž   s    	 	    Ã   c          C   sD  t  j j t d ƒ }  d } |  j } t | ƒ } | | k } | s.t j d | f d | | f ƒ i t j | ƒ d 6t j | ƒ d 6d t	 j
 ƒ  k s¤ t j t ƒ r³ t j t ƒ n d d 6d	 t	 j
 ƒ  k sÛ t j |  ƒ rê t j |  ƒ n d	 d
 6t j | ƒ d 6} d i | d 6} t t j | ƒ ƒ ‚ n  d  } } } } d  S(   NsH   
        IniConfig("x", data='[section]\nname = Alice\nname = bob')
    s   duplicate nameRo   sK   %(py1)s in %(py8)s
{%(py8)s = %(py3)s(%(py6)s
{%(py6)s = %(py4)s.value
})
}RN   RK   RI   RL   RU   R4   RM   R3   s   assert %(py10)sRe   (   Ro   (   sK   %(py1)s in %(py8)s
{%(py8)s = %(py3)s(%(py6)s
{%(py6)s = %(py4)s.value
})
}s   assert %(py10)s(   R,   R-   R.   R   R   RI   R5   R6   R:   R7   R8   R9   R;   R<   R=   (   RU   Rp   RP   Rj   RO   RS   Rk   (    (    s<   /home/ronny/Projects/pytest-dev/py/testing/test_iniconfig.pyt"   test_iniconfig_duplicate_key_fails¤   s    	 	    Ã   c          C   s  t  d d d ƒ}  |  j } d } | | ƒ } | d  k } | s+t j d' | f d( | d  f ƒ i d t j ƒ  k s t j |  ƒ r t j |  ƒ n d d 6d	 t j ƒ  k s¸ t j d  ƒ rÇ t j d  ƒ n d	 d
 6t j | ƒ d 6t j | ƒ d 6t j | ƒ d 6} d) i | d 6} t	 t j
 | ƒ ƒ ‚ n  d  } } } } |  j } d } | | ƒ } d } | | k } | s5t j d* | f d+ | | f ƒ i d t j ƒ  k s²t j |  ƒ rÁt j |  ƒ n d d 6t j | ƒ d 6t j | ƒ d 6t j | ƒ d 6t j | ƒ d 6} d, i | d 6}	 t	 t j
 |	 ƒ ƒ ‚ n  d  } } } } } |  j } d } | | ƒ } d } | | k } | sCt j d- | f d. | | f ƒ i d t j ƒ  k sÀt j |  ƒ rÏt j |  ƒ n d d 6t j | ƒ d 6t j | ƒ d 6t j | ƒ d 6t j | ƒ d 6} d/ i | d 6}	 t	 t j
 |	 ƒ ƒ ‚ n  d  } } } } } |  j } d } d } | | | ƒ } d }
 | |
 k } | sjt j d0 | f d1 | |
 f ƒ i t j | ƒ d
 6d t j ƒ  k sçt j |  ƒ röt j |  ƒ n d d 6t j | ƒ d 6t j | ƒ d 6t j | ƒ d 6t j |
 ƒ d 6}	 d2 i |	 d 6} t	 t j
 | ƒ ƒ ‚ n  d  } } } } } }
 |  j } d } d } | | | ƒ } d }
 | |
 k } | s•t j d3 | f d4 | |
 f ƒ i t j | ƒ d
 6d t j ƒ  k st j |  ƒ r!t j |  ƒ n d d 6t j | ƒ d 6t j | ƒ d 6t j | ƒ d 6t j |
 ƒ d 6}	 d5 i |	 d 6} t	 t j
 | ƒ ƒ ‚ n  d  } } } } } }
 |  d } | j } d } | | ƒ } d } | | k } | sŠt j d6 | f d7 | | f ƒ i t j | ƒ d! 6t j | ƒ d" 6t j | ƒ d# 6t j | ƒ d 6t j | ƒ d$ 6} d8 i | d& 6} t	 t j
 | ƒ ƒ ‚ n  d  } } } } } } |  d } | j } d } | | ƒ } d } | | k } | st j d9 | f d: | | f ƒ i t j | ƒ d! 6t j | ƒ d" 6t j | ƒ d# 6t j | ƒ d 6t j | ƒ d$ 6} d; i | d& 6} t	 t j
 | ƒ ƒ ‚ n  d  } } } } } } d  S(<   Ns   x.init   datas1   [section]
value = 1
[section2]
# comment
value =2t   missingt   issL   %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.lineof
}(%(py4)s)
} is %(py8)sRc   R1   R=   RN   R2   R4   RM   R3   s   assert %(py10)sRe   R   i   s   ==sL   %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.lineof
}(%(py4)s)
} == %(py9)sRW   s   assert %(py11)st   py11t   section2i   R   i   sV   %(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s.lineof
}(%(py4)s, %(py6)s)
} == %(py11)ss   assert %(py13)st   py13i   sM   %(py7)s
{%(py7)s = %(py3)s
{%(py3)s = %(py1)s.lineof
}(%(py5)s)
} == %(py10)sRK   RL   Rd   RV   s   assert %(py12)st   py12(   Ru   (   sL   %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.lineof
}(%(py4)s)
} is %(py8)ss   assert %(py10)s(   s   ==(   sL   %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.lineof
}(%(py4)s)
} == %(py9)ss   assert %(py11)s(   s   ==(   sL   %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.lineof
}(%(py4)s)
} == %(py9)ss   assert %(py11)s(   s   ==(   sV   %(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s.lineof
}(%(py4)s, %(py6)s)
} == %(py11)ss   assert %(py13)s(   s   ==(   sV   %(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s.lineof
}(%(py4)s, %(py6)s)
} == %(py11)ss   assert %(py13)s(   s   ==(   sM   %(py7)s
{%(py7)s = %(py3)s
{%(py3)s = %(py1)s.lineof
}(%(py5)s)
} == %(py10)ss   assert %(py12)s(   s   ==(   sM   %(py7)s
{%(py7)s = %(py3)s
{%(py3)s = %(py1)s.lineof
}(%(py5)s)
} == %(py10)ss   assert %(py12)s(   R    t   lineofR=   R5   R6   R7   R8   R9   R:   R;   R<   (   Rc   R>   RD   RP   Rj   RS   Rk   t   @py_assert8R[   t   @py_format12t   @py_assert10t   @py_assert9t   @py_format14Rp   RO   RQ   RY   t   @py_format13(    (    s<   /home/ronny/Projects/pytest-dev/py/testing/test_iniconfig.pyt   test_iniconfig_lineof«   s–    			     Ã   	      œ   	      œ   	       ¬   	       ¬   
 	      u   
 	      u   c          C   s©  t  d d d ƒ}  |  j } d } d } | | | ƒ } d } | | k } | s#t j d | f d | | f ƒ i t j | ƒ d	 6d
 t j ƒ  k s  t j |  ƒ r¯ t j |  ƒ n d
 d 6t j | ƒ d 6t j | ƒ d 6t j | ƒ d 6t j | ƒ d 6} d i | d 6} t t j	 | ƒ ƒ ‚ n  d  } } } } } } |  j } d } d } | | | d t ƒ}	 d }
 |	 |
 k } | s‹t j d | f d |	 |
 f ƒ i t j |	 ƒ d 6d
 t j ƒ  k sÑt j |  ƒ ràt j |  ƒ n d
 d 6t j |
 ƒ d 6t j | ƒ d 6t j | ƒ d 6t j | ƒ d 6d t j ƒ  k sHt j t ƒ rWt j t ƒ n d d 6} d  i | d 6} t t j	 | ƒ ƒ ‚ n  d  } } } }	 } }
 d  S(!   NR   Rs   s   [section]
int = 1
float = 1.1R   t   intR    s   ==sS   %(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s.get
}(%(py4)s, %(py6)s)
} == %(py11)sRN   Rc   R1   R2   R4   RM   Rv   R3   s   assert %(py13)sRx   t   converti   sd   %(py9)s
{%(py9)s = %(py2)s
{%(py2)s = %(py0)s.get
}(%(py4)s, %(py6)s, convert=%(py7)s)
} == %(py12)sRW   Ry   RV   s   assert %(py14)st   py14(   s   ==(   sS   %(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s.get
}(%(py4)s, %(py6)s)
} == %(py11)ss   assert %(py13)s(   s   ==(   sd   %(py9)s
{%(py9)s = %(py2)s
{%(py2)s = %(py0)s.get
}(%(py4)s, %(py6)s, convert=%(py7)s)
} == %(py12)ss   assert %(py14)s(   R    t   getR5   R6   R:   R7   R8   R9   R;   R<   R=   R‚   (   Rc   R>   RD   RP   Rj   R}   R~   R|   R   R{   t   @py_assert11R€   t   @py_format15(    (    s<   /home/ronny/Projects/pytest-dev/py/testing/test_iniconfig.pyt   test_iniconfig_get_convert½   s.    	       ¬   	       ã   c          C   s©  t  d d d ƒ}  |  j } d } d } d } | | | d | ƒ} d } | | k } | s?t j d | f d | | f ƒ i t j | ƒ d
 6d t j ƒ  k s¬ t j |  ƒ r» t j |  ƒ n d d 6t j | ƒ d 6t j | ƒ d 6t j | ƒ d 6t j | ƒ d 6t j | ƒ d 6} d i | d 6}	 t t j	 |	 ƒ ƒ ‚ n  d  } } } } } } } |  j } d } d } | | | ƒ } | d  k } | st j d | f d | d  f ƒ i t j | ƒ d
 6d t j ƒ  k såt j |  ƒ rôt j |  ƒ n d d 6t j | ƒ d 6t j | ƒ d 6d t j ƒ  k s<t j d  ƒ rKt j d  ƒ n d d 6t j | ƒ d 6}
 d i |
 d 6} t t j	 | ƒ ƒ ‚ n  d  } } } } } d  S(    NR   Rs   s   [section]
int = 1
float = 1.1R   Rt   i   t   defaults   ==sf   %(py10)s
{%(py10)s = %(py2)s
{%(py2)s = %(py0)s.get
}(%(py4)s, %(py6)s, default=%(py8)s)
} == %(py13)sRN   Rc   R1   R2   R4   Rx   Re   RM   R3   s   assert %(py15)st   py15Ru   sS   %(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s.get
}(%(py4)s, %(py6)s)
} is %(py10)sR=   s   assert %(py12)sRy   (   s   ==(   sf   %(py10)s
{%(py10)s = %(py2)s
{%(py2)s = %(py0)s.get
}(%(py4)s, %(py6)s, default=%(py8)s)
} == %(py13)ss   assert %(py15)s(   Ru   (   sS   %(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s.get
}(%(py4)s, %(py6)s)
} is %(py10)ss   assert %(py12)s(   R    R…   R5   R6   R:   R7   R8   R9   R;   R<   R=   (   Rc   R>   RD   RP   Rj   R~   t   @py_assert12R†   R   t   @py_format16Rk   R€   (    (    s<   /home/ronny/Projects/pytest-dev/py/testing/test_iniconfig.pyt   test_iniconfig_get_missingÂ   s.    	        ¼   	      Ó   c          C   sÁ  t  d d d ƒ}  |  d } | j } d } | | d t ƒ} d } | | k } | sQt j d | f d | | f ƒ i d t j ƒ  k s— t j | ƒ r¦ t j | ƒ n d d
 6t j | ƒ d 6t j | ƒ d 6d t j ƒ  k sî t j t ƒ rý t j t ƒ n d d 6t j | ƒ d 6t j | ƒ d 6} d i | d 6} t	 t j
 | ƒ ƒ ‚ n  d  } } } } } | j } d } d }	 | | |	 ƒ }
 d } |
 | k } | sxt j d  | f d! |
 | f ƒ i t j |
 ƒ d 6d t j ƒ  k sõt j | ƒ rt j | ƒ n d d
 6t j | ƒ d 6t j | ƒ d 6t j |	 ƒ d 6t j | ƒ d 6} d" i | d 6} t	 t j
 | ƒ ƒ ‚ n  d  } } }	 }
 } } | j } d } d }	 | | |	 ƒ }
 d } |
 | k } | s£t j d# | f d$ |
 | f ƒ i t j |
 ƒ d 6d t j ƒ  k s t j | ƒ r/t j | ƒ n d d
 6t j | ƒ d 6t j | ƒ d 6t j |	 ƒ d 6t j | ƒ d 6} d% i | d 6} t	 t j
 | ƒ ƒ ‚ n  d  } } }	 }
 } } d  S(&   NR   Rs   s   [section]
value=1R   R   Rƒ   i   s   ==s[   %(py7)s
{%(py7)s = %(py2)s
{%(py2)s = %(py0)s.get
}(%(py4)s, convert=%(py5)s)
} == %(py10)sR1   R2   R4   R‚   Rd   Re   RV   R3   s   assert %(py12)sRy   R    sS   %(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s.get
}(%(py4)s, %(py6)s)
} == %(py11)sRN   RM   Rv   s   assert %(py13)sRx   Rt   i   (   s   ==(   s[   %(py7)s
{%(py7)s = %(py2)s
{%(py2)s = %(py0)s.get
}(%(py4)s, convert=%(py5)s)
} == %(py10)ss   assert %(py12)s(   s   ==(   sS   %(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s.get
}(%(py4)s, %(py6)s)
} == %(py11)ss   assert %(py13)s(   s   ==(   sS   %(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s.get
}(%(py4)s, %(py6)s)
} == %(py11)ss   assert %(py13)s(   R    R…   R‚   R5   R6   R7   R8   R9   R:   R;   R<   R=   (   Rc   R   R>   RD   RY   R~   R{   Rk   R€   RP   Rj   R}   R|   R   (    (    s<   /home/ronny/Projects/pytest-dev/py/testing/test_iniconfig.pyt   test_section_getÇ   sD    
	      Ó   	       ¬   	       ¬   c          C   s)   t  d d d ƒ}  t j j t d ƒ d  S(   NR   Rs   s   [section]
value=1s   config["other"](   R    R,   R-   R.   t   KeyError(   Rc   (    (    s<   /home/ronny/Projects/pytest-dev/py/testing/test_iniconfig.pyt   test_missing_sectionÎ   s    c          C   sZ  t  d d d ƒ}  |  d d } d } | | k } | s¦ t j d | f d | | f ƒ i t j | ƒ d	 6t j | ƒ d
 6} d i | d 6} t t j | ƒ ƒ ‚ n  d  } } } |  d d } d } | | k } | sHt j d | f d | | f ƒ i t j | ƒ d	 6t j | ƒ d
 6} d i | d 6} t t j | ƒ ƒ ‚ n  d  } } } d  S(   NR   Rs   s   [section]
value=1R   R   R    s   ==s   %(py1)s == %(py4)sRK   R4   R3   s   assert %(py6)sRM   (   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   R    R5   R6   R:   R;   R<   R=   (   Rc   Rp   RD   RO   R@   RR   (    (    s<   /home/ronny/Projects/pytest-dev/py/testing/test_iniconfig.pyt   test_section_getitemÒ   s"        E       E   c          C   s°  t  d d d ƒ}  t |  d ƒ } d g } | | k } | sÒ t j d | f d | | f ƒ i d t j ƒ  k s t j | ƒ rŽ t j | ƒ n d d	 6t j | ƒ d
 6} d i | d 6} t t j	 | ƒ ƒ ‚ n  d  } } t |  d j ƒ  ƒ } d g } | | k } | s¢t j d | f d | | f ƒ i d t j ƒ  k sOt j | ƒ r^t j | ƒ n d d	 6t j | ƒ d
 6} d i | d 6} t t j	 | ƒ ƒ ‚ n  d  } } d  S(   NR   Rs   s   [section]
value=1R   R   s   ==s   %(py0)s == %(py3)sR   R1   RL   R3   s   assert %(py5)sRd   R    R   (   s   ==(   s   %(py0)s == %(py3)ss   assert %(py5)s(   s   valueR    (   s   ==(   s   %(py0)s == %(py3)ss   assert %(py5)s(   R    Rb   R5   R6   R7   R8   R9   R:   R;   R<   R=   R   (   Rc   R   RO   R>   RE   t   @py_format6R   (    (    s<   /home/ronny/Projects/pytest-dev/py/testing/test_iniconfig.pyt   test_section_iter×   s"    	   l   
	   l   c    
      C   sð  t  d d t d ƒ ƒ}  t |  ƒ } t | ƒ } d } | | k } | s$t j d | f d | | f ƒ i d t j ƒ  k sŠ t j t ƒ r™ t j	 t ƒ n d d 6d	 t j ƒ  k sÁ t j | ƒ rÐ t j	 | ƒ n d	 d
 6t j	 | ƒ d 6t j	 | ƒ d 6} d i | d 6} t
 t j | ƒ ƒ ‚ n  d  } } } | d } | j } d } | | k } | sÛt j d | f d | | f ƒ i t j	 | ƒ d
 6t j	 | ƒ d 6t j	 | ƒ d 6} d  i | d 6} t
 t j | ƒ ƒ ‚ n  d  } } } } | d d } d } | | k } | st j d! | f d" | | f ƒ i t j	 | ƒ d
 6t j	 | ƒ d 6}	 d# i |	 d 6} t
 t j | ƒ ƒ ‚ n  d  } } } | d } | j } d } | | k } | s8t j d$ | f d% | | f ƒ i t j	 | ƒ d
 6t j	 | ƒ d 6t j	 | ƒ d 6} d& i | d 6} t
 t j | ƒ ƒ ‚ n  d  } } } } | d d } d } | | k } | sÞt j d' | f d( | | f ƒ i t j	 | ƒ d
 6t j	 | ƒ d 6}	 d) i |	 d 6} t
 t j | ƒ ƒ ‚ n  d  } } } d  S(*   Ns   x.iniRs   sS   
          [section1]
          value=1
          [section2]
          value=2
    i   s   ==s0   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)st   lenR1   t   lRK   RL   RM   R3   s   assert %(py8)sRN   i    t   section1s,   %(py3)s
{%(py3)s = %(py1)s.name
} == %(py6)sR   R    s   %(py1)s == %(py4)sR4   s   assert %(py6)si   Rw   t   2(   s   ==(   s0   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)ss   assert %(py8)s(   s   ==(   s,   %(py3)s
{%(py3)s = %(py1)s.name
} == %(py6)ss   assert %(py8)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s,   %(py3)s
{%(py3)s = %(py1)s.name
} == %(py6)ss   assert %(py8)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   R    R   Rb   R”   R5   R6   R7   R8   R9   R:   R;   R<   R=   R   (
   Rc   R•   RO   RP   RQ   RR   RS   Rp   RD   R@   (    (    s<   /home/ronny/Projects/pytest-dev/py/testing/test_iniconfig.pyt   test_config_iterÞ   sZ        ³   
 	    U       E   
 	    U       E   c          C   sA  t  d d t d ƒ ƒ}  d } | |  k } | sÅ t j d | f d | |  f ƒ i t j | ƒ d 6d t j ƒ  k s‚ t j |  ƒ r‘ t j |  ƒ n d d	 6} d i | d 6} t t j	 | ƒ ƒ ‚ n  d  } } d } | |  k } | s|t j d | f d | |  f ƒ i t j | ƒ d 6d t j ƒ  k s9t j |  ƒ rHt j |  ƒ n d d	 6} d i | d 6} t t j	 | ƒ ƒ ‚ n  d  } } d } | |  k } | s3t j d | f d | |  f ƒ i t j | ƒ d 6d t j ƒ  k sðt j |  ƒ rÿt j |  ƒ n d d	 6} d i | d 6} t t j	 | ƒ ƒ ‚ n  d  } } d  S(   Ns   x.iniRs   sS   
          [section1]
          value=1
          [section2]
          value=2
    t   xyzs   not ins   %(py1)s not in %(py3)sRK   Rc   RL   R3   s   assert %(py5)sRd   R–   Ro   s   %(py1)s in %(py3)sRw   (   s   not in(   s   %(py1)s not in %(py3)ss   assert %(py5)s(   Ro   (   s   %(py1)s in %(py3)ss   assert %(py5)s(   Ro   (   s   %(py1)s in %(py3)ss   assert %(py5)s(   R    R   R5   R6   R:   R7   R8   R9   R;   R<   R=   (   Rc   Rp   RO   RE   R’   (    (    s<   /home/ronny/Projects/pytest-dev/py/testing/test_iniconfig.pyt   test_config_containsì   s.       l   
   l   
   l   c          C   sñ  t  d d d ƒ}  t |  ƒ } g  | D] } | j ^ q% } d d g } | | k } | sí t j d | f d | | f ƒ i d t j ƒ  k sš t j | ƒ r© t j | ƒ n d d	 6t j | ƒ d
 6} d i | d 6} t	 t j
 | ƒ ƒ ‚ n  d  } } |  d } t | ƒ } d d g }	 | |	 k }
 |
 sàt j d |
 f d | |	 f ƒ i d t j ƒ  k smt j t ƒ r|t j t ƒ n d d	 6t j | ƒ d 6t j | ƒ d 6t j |	 ƒ d 6} d i | d 6} t	 t j
 | ƒ ƒ ‚ n  d  } } }
 }	 |  d } t | ƒ } d d g }	 | |	 k }
 |
 sÛt j d |
 f d  | |	 f ƒ i d t j ƒ  k sht j t ƒ rwt j t ƒ n d d	 6t j | ƒ d 6t j | ƒ d 6t j |	 ƒ d 6} d! i | d 6} t	 t j
 | ƒ ƒ ‚ n  d  } } }
 }	 d  S("   Ns   x.iniRs   sx   
[section2] #cpython dict ordered before section
value = 1
value2 = 2 # dict ordered before value
[section]
a = 1
b = 2
Rw   R   s   ==s   %(py0)s == %(py3)st   secnamesR1   RL   R3   s   assert %(py5)sRd   R   t   value2s0   %(py4)s
{%(py4)s = %(py0)s(%(py2)s)
} == %(py7)sRb   R2   R4   RV   s   assert %(py9)sRW   t   at   b(   s   ==(   s   %(py0)s == %(py3)ss   assert %(py5)s(   s   ==(   s0   %(py4)s
{%(py4)s = %(py0)s(%(py2)s)
} == %(py7)ss   assert %(py9)s(   s   ==(   s0   %(py4)s
{%(py4)s = %(py0)s(%(py2)s)
} == %(py7)ss   assert %(py9)s(   R    Rb   R   R5   R6   R7   R8   R9   R:   R;   R<   R=   (   Rc   R•   R   R›   RO   R>   RE   R’   RD   RY   RP   RZ   R[   (    (    s<   /home/ronny/Projects/pytest-dev/py/testing/test_iniconfig.pyt   test_iter_file_order÷   s:    		   l   

     Œ   
     Œ   c          C   sÀ  t  d d t d ƒ ƒ}  t |  ƒ \ } } } | d } d } | | k } | s½ t j d | f d | | f ƒ i t j | ƒ d 6t j | ƒ d	 6} d i | d 6} t t j | ƒ ƒ ‚ n  d  } } } | d } d } | | k } | s[t j d | f d | | f ƒ i t j | ƒ d 6t j | ƒ d	 6} d i | d 6} t t j | ƒ ƒ ‚ n  d  } } } | d } d } | | k } | sùt j d | f d  | | f ƒ i t j | ƒ d 6t j | ƒ d	 6} d! i | d 6} t t j | ƒ ƒ ‚ n  d  } } } | d } d } | | k } | s—t j d" | f d# | | f ƒ i t j | ƒ d 6t j | ƒ d	 6} d$ i | d 6} t t j | ƒ ƒ ‚ n  d  } } } d d d g } t | ƒ }	 | |	 k } | s®t j d% | f d& | |	 f ƒ i t j | ƒ d 6d t	 j
 ƒ  k s$t j t ƒ r3t j t ƒ n d d 6d t	 j
 ƒ  k s[t j | ƒ rjt j | ƒ n d d	 6t j |	 ƒ d 6} d' i | d 6}
 t t j |
 ƒ ƒ ‚ n  d  } } }	 d  S((   Nt   pypircRs   s:  
        [distutils]
        index-servers =
            pypi
            other

        [pypi]
        repository: <repository-url>
        username: <username>
        password: <password>

        [other]
        repository: http://example.com/pypi
        username: <username>
        password: <password>
    s   index-serverss
   pypi
others   ==s   %(py1)s == %(py4)sRK   R4   R3   s   assert %(py6)sRM   t
   repositorys   <repository-url>t   usernames
   <username>t   passwords
   <password>s0   %(py1)s == %(py6)s
{%(py6)s = %(py3)s(%(py4)s)
}Rb   RL   t   others   assert %(py8)sRN   (   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s0   %(py1)s == %(py6)s
{%(py6)s = %(py3)s(%(py4)s)
}s   assert %(py8)s(   R    R   Rb   R5   R6   R:   R;   R<   R=   R7   R8   R9   (   Rc   t	   distutilst   pypiR¤   Rp   RD   RO   R@   RR   RP   RS   (    (    s<   /home/ronny/Projects/pytest-dev/py/testing/test_iniconfig.pyt   test_example_pypirc  sV    
    E   
    E   
    E   
    E       ³   c          C   sÁ   d d g }  t  |  k } | s³ t j d | f d t  |  f ƒ i d t j ƒ  k s` t j t  ƒ ro t j t  ƒ n d d 6t j |  ƒ d 6} d i | d
 6} t t j | ƒ ƒ ‚ n  d  } }  d  S(   NR    R   s   ==s   %(py0)s == %(py3)st   ALLR1   RL   R3   s   assert %(py5)sRd   (   s   ==(   s   %(py0)s == %(py3)ss   assert %(py5)s(
   R¨   R5   R6   R7   R8   R9   R:   R;   R<   R=   (   RO   R>   RE   R’   (    (    s<   /home/ronny/Projects/pytest-dev/py/testing/test_iniconfig.pyt   test_api_import  s       l   s   #qwes     #qwes   ;qwes    ;qwec         C   sÀ   t  |  ƒ } | s¶ d d i d t j ƒ  k s= t j t  ƒ rL t j t  ƒ n d d 6d t j ƒ  k st t j |  ƒ rƒ t j |  ƒ n d d 6t j | ƒ d 6} t t j | ƒ ƒ ‚ n  d  } d  S(   NR3   s,   assert %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
}R   R1   R_   RK   RL   (	   R   R7   R8   R5   R9   R:   R;   R<   R=   (   R_   RO   RE   (    (    s<   /home/ronny/Projects/pytest-dev/py/testing/test_iniconfig.pyt   test_iscommentline_true"  s
      Œ  (   i    s   sectionNN(   i    Ns   valueR    (   i    s   sectionNN(   i   s   sections   valueR    (   i    Ns   namess	   Alice
Bob(   i    Ns   namess	   Alice
Bob(   i    s   sectionNN(   i   s   sections   valueR    (   i    Ns   valueR    (   i    s   sectionNN(   i    s   sectionNN(   i    Ns   names   value [](   i    Ns   values   x = 3(   i    Ns   nameR   (   i    Ns   values   y=5(   i    Ns   values   xyz:5(2   t   __builtin__R7   t   _pytest.assertion.rewritet	   assertiont   rewriteR5   R,   t   pytestt   py._iniconfigR    R   R   R¨   R   t   textwrapR   R   R   R=   R   R+   R/   RA   RF   RT   R\   R]   R^   R-   t   markR	   R`   Rl   Rn   Rq   Rr   R   Rˆ   R   RŽ   R   R‘   R“   R˜   Rš   RŸ   R§   R©   t   parametrizeRª   (    (    (    s<   /home/ronny/Projects/pytest-dev/py/testing/test_iniconfig.pyt   <module>   s     		


									
															