
:W               $   @   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 d   Z d d   Z d	 d
 dm g f d d dn g f d d do dp g f d d dq g f d d dr g f d d ds dt g f d d g  f d d du g f d d dv g f d d  g  f d! d" dw g f d# d$ dx g f d' d( dy g f d* d+ dz g f d- d. d{ g f d0 d1 d| g f i Z d3 d4   Z d5 d6   Z d7 d8   Z d9 d:   Z d; d<   Z d= d>   Z d? d@   Z dA dB   Z e j j j dC dD g  dE dF    Z dG dH   Z dI dJ   Z  dK dL   Z! dM dN   Z" dO dP   Z# dQ dR   Z$ dS dT   Z% dU dV   Z& dW dX   Z' dY dZ   Z( d[ d\   Z) d] d^   Z* d_ d`   Z+ da db   Z, dc dd   Z- de df   Z. e j j/ dC dg dh di dj g  dk dl    Z0 d S)}    N)	IniConfig
ParseError__all__)iscommentline)dedentc          	   C   s   d |  j  k rW x t j   D]4 \ } \ } } |  j d | d d | d | i  q Wnu t |  j d  r |  j j j } t | j     \ } } t	 |   } x- | D]% } |  j d t
 t | |    q Wd  S)Ninputidfuncargsexpectedmulti)funcargnamescheck_tokensitemsaddcallhasattrfunctionr   kwargszipcartesian_productdict)metafuncnamer   r
   r   namesvaluesp r   </home/ronny/Projects/pytest-dev/py/testing/test_iniconfig.pypytest_generate_tests   s    r   c             g   sk   | s" x^ |  D] } | f Vq WnE xB |  D]: } x1 t  | d | d d    D] } | f | VqM Wq) Wd  S)Nr      )r   )LZlistsxyr   r   r   r      s    $r   sectionz	[section]valuez	value = 11zvalue in sectionz[section]
value=1r   zvalue with continuationznames =
 Alice
 Bobr   	Alice
Bobzvalue with aligned continuationznames = Alice
        Bobz
blank linez[section]

value=1   commentz	# commentzcomment on valuezcomment on sectionz[section] #commentZcomment2z	; commentzcomment2 on sectionz[section] ;commentzpseudo section syntax in valuezname = value []r   value []zassignment in valuezvalue = x = 3x = 3zuse of colon for name-valueszname: yr!   zuse of colon without spacez	value:y=5y=5zequality gets precedencezvalue=xyz:5xyz:5c             C   s.   t  j t  } d | _ | j |  j d   S)NsampleT)object__new__r   path_parse
splitlines)r   inir   r   r   parsef   s    	r3   c             C   s   t  j j t t |   S)N)pytestraisesr   r3   )r   r   r   r   parse_a_errorl   s    r7   c             C   s   t  |   } | | k } | s t j d
 | f d | | f  d d t j   k s` t j |  ro t j |  n d d d t j   k s t j |  r t j |  n d i } d d	 | i } t t j |    d  } d  S)N==%(py0)s == %(py2)spy0parsedpy2r
    assert %(py4)spy4)r8   )r9   r>   )	r3   
@pytest_ar_call_reprcompare@py_builtinslocals_should_repr_global_name	_safereprAssertionError_format_explanation)r   r
   r;   @py_assert1Z@py_format3@py_format5r   r   r   test_tokenizeo   s         rJ   c              C   s  t  d  }  |  } | sn d	 d d t j   k s@ t j |   rO t j |   n d i } t t j |    d  } t d d  } | j	 } | } | sd d d d t j   k s t j |  r t j |  n d d t j |  i } t t j |    d  } } d  S)
Nr=   assert not %(py0)sr:   r;   r,   z0assert not %(py2)s
{%(py2)s = %(py0)s.sections
}r2   r<   rK   )
r3   rB   rC   r@   rD   rE   rF   rG   r   sections)r;   rH   Z@py_format2r2   @py_assert3@py_format4r   r   r   test_parse_emptys   s      @  	   S  rO   c           
   C   s  t  d d d  }  t |   } d } | | k } | s
t j d | f d | | f  d d t j   k sx t j |   r t j |   n d d	 t j |  d
 d t j   k s t j t  r t j t  n d d t j |  i } d d | i } t t j	 |    d  } } } d  S)Nfilenamer   Zhellozfilename:1: hellor8   0%(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)spy1epy6r:   strpy3r=   assert %(py8)spy8)r8   )rQ   rW   )
r   rU   r@   rA   rB   rC   rD   rE   rF   rG   )rS   @py_assert2@py_assert5@py_assert4@py_format7@py_format9r   r   r   test_ParseErrory   s           r^   c           
   C   s   t  d  }  |  j } | j } d } | | k } | s t j d | f d | | f  d t j |  d d t j   k s t j |   r t j |   n d d t j |  d	 t j |  i } d d | i } t	 t j
 |    d  } } } } d  S)Nz Foor   r8   I%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.value
}.lineno
} == %(py7)sr?   r:   excinfor<   py7r=   assert %(py9)spy9)r8   )r_   rb   )r7   r#   linenor@   rA   rE   rB   rC   rD   rF   rG   )r`   rH   rM   @py_assert6rZ   @py_format8@py_format10r   r   r   (test_continuation_needs_perceeding_token}   s    	 	       rh   c           
   C   s   t  d  }  |  j } | j } d } | | k } | s t j d | f d | | f  d t j |  d d t j   k s t j |   r t j |   n d d t j |  d	 t j |  i } d d | i } t	 t j
 |    d  } } } } d  S)Nz[section]
 Foor   r8   I%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.value
}.lineno
} == %(py7)sr?   r:   r`   r<   ra   r=   assert %(py9)src   )r8   )ri   rj   )r7   r#   rd   r@   rA   rE   rB   rC   rD   rF   rG   )r`   rH   rM   re   rZ   rf   rg   r   r   r   'test_continuation_cant_be_after_section   s    	 	       rk   c              C   s   t  d  }  d  S)Nz[])r7   )r`   r   r   r   test_section_cant_be_empty   s    rl   linez!!c             C   s   t  |   d  S)N)r7   )rm   r   r   r   test_error_on_weird_lines   s    rn   c       	      C   s  |  d } | j  d  t d |  } | j } t |  } d g } | | k } | s9t j d | f d | | f  d t j |  d d	 t j   k s t j	 |  r t j |  n d	 d
 t j |  d d t j   k s t j	 t  r t j t  n d d t j |  i } d d | i } t
 t j |    d  } } } } t | d  } | j } t |  } d g } | | k } | smt j d | f d | | f  d t j |  d d	 t j   k st j	 |  rt j |  n d	 d
 t j |  d d t j   k s t j	 t  r/t j t  n d d t j |  i } d d | i } t
 t j |    d  } } } } t j j t d  d  S)Nztest.txtz[metadata]
name=1r/   metadatar8   N%(py5)s
{%(py5)s = %(py0)s(%(py3)s
{%(py3)s = %(py1)s.sections
})
} == %(py8)spy5rR   configrX   r:   listrV   r=   assert %(py10)spy10z[diff]diffzIniConfig(data=path.read()))r8   )rp   rt   )r8   )rp   rt   )writer   rL   rs   r@   rA   rE   rB   rC   rD   rF   rG   r4   r5   r6   	TypeError)	tmpdirr/   rr   rY   r[   @py_assert7re   r]   @py_format11r   r   r   test_iniconfig_from_file   s.    
	  	      	  	      r|   c          
   C   s  t  j j t d  } | j } | j } d } | | k } | s t j d | f d | | f  d t j |  d d t	 j
   k s t j |  r t j |  n d d t j |  d	 t j |  i } d d | i } t t j |    d  } } } } d  S)Nz+
        IniConfig("x", data='name=1')
    zno section header definedr8   F%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.value
}.msg
} == %(py7)sr?   r:   r`   r<   ra   r=   assert %(py9)src   )r8   )r}   r~   )r4   r5   r6   r   r#   msgr@   rA   rE   rB   rC   rD   rF   rG   )ry   r`   rH   rM   re   rZ   rf   rg   r   r   r   test_iniconfig_section_first   s    		 	       r   c              C   s;  t  j j t d  }  d } |  j } t |  } | | k } | s%t j d | f d | | f  d d t j	   k s t j
 |   r t j |   n d d t j |  d t j |  d	 d
 t j	   k s t j
 t  r t j t  n d
 d t j |  i } d d | i } t t j |    d  } } } } d  S)Nz9
        IniConfig("x", data='[section]\n[section]')
    zduplicate sectioninK%(py1)s in %(py8)s
{%(py8)s = %(py3)s(%(py6)s
{%(py6)s = %(py4)s.value
})
}r?   r`   rR   rT   rV   rU   rX   r=   assert %(py10)sru   )r   )r   r   )r4   r5   r6   r   r#   rU   r@   rA   rB   rC   rD   rE   rF   rG   )r`   @py_assert0rZ   rz   rY   r]   r{   r   r   r   %test_iniconig_section_duplicate_fails   s    	 	       r   c              C   s;  t  j j t d  }  d } |  j } t |  } | | k } | s%t j d | f d | | f  d d t j	   k s t j
 |   r t j |   n d d t j |  d t j |  d	 d
 t j	   k s t j
 t  r t j t  n d
 d t j |  i } d d | i } t t j |    d  } } } } d  S)NzH
        IniConfig("x", data='[section]\nname = Alice\nname = bob')
    zduplicate namer   K%(py1)s in %(py8)s
{%(py8)s = %(py3)s(%(py6)s
{%(py6)s = %(py4)s.value
})
}r?   r`   rR   rT   rV   rU   rX   r=   assert %(py10)sru   )r   )r   r   )r4   r5   r6   r   r#   rU   r@   rA   rB   rC   rD   rE   rF   rG   )r`   r   rZ   rz   rY   r]   r{   r   r   r   "test_iniconfig_duplicate_key_fails   s    	 	       r   c              C   s?  t  d d d }  |  j } d } | |  } d  } | | k } | st j d% | f d& | | f  d t j |  d t j |  d	 t j |  d
 d t j   k s t j |   r t j |   n d d t j |  i } d' d | i } t t j	 |    d  } } } } } |  j } d } | |  } d } | | k } | st j d( | f d) | | f  d t j |  d t j |  d	 t j |  d
 d t j   k st j |   rt j |   n d d t j |  i } d* d | i } t t j	 |    d  } } } } } |  j } d } | |  } d } | | k } | st j d+ | f d, | | f  d t j |  d t j |  d	 t j |  d
 d t j   k st j |   rt j |   n d d t j |  i } d- d | i } t t j	 |    d  } } } } } |  j } d } d } | | |  } d } | | k }	 |	 s(t j d. |	 f d/ | | f  d t j |  d
 d t j   k st j |   rt j |   n d d t j |  d	 t j |  d t j |  d t j |  i } d0 d | i }
 t t j	 |
    d  } } } } }	 } |  j } d } d } | | |  } d } | | k }	 |	 sIt j d1 |	 f d2 | | f  d t j |  d
 d t j   k st j |   rt j |   n d d t j |  d	 t j |  d t j |  d t j |  i } d3 d | i }
 t t j	 |
    d  } } } } }	 } |  d } | j } d } | |  } d }	 | |	 k } | s5t j d4 | f d5 | |	 f  d t j |	  d t j |  d  t j |  d! t j |  d" t j |  i } d6 d$ | i } t t j	 |    d  } } } } } }	 |  d } | j } d } | |  } d }	 | |	 k } | s!t j d7 | f d8 | |	 f  d t j |	  d t j |  d  t j |  d! t j |  d" t j |  i } d9 d$ | i } t t j	 |    d  } } } } } }	 d  S):Nzx.inidataz1[section]
value = 1
[section2]
# comment
value =2missingisL%(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.lineof
}(%(py4)s)
} is %(py9)sr?   rc   rT   r:   rr   r<   r=   assert %(py11)spy11r"   r   r8   L%(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.lineof
}(%(py4)s)
} == %(py9)ssection2   r#   r&   V%(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s.lineof
}(%(py4)s, %(py6)s)
} == %(py11)srX   assert %(py13)spy13   M%(py7)s
{%(py7)s = %(py3)s
{%(py3)s = %(py1)s.lineof
}(%(py5)s)
} == %(py10)sru   rR   ra   rV   rq   assert %(py12)spy12)r   )r   r   )r8   )r   r   )r8   )r   r   )r8   )r   r   )r8   )r   r   )r8   )r   r   )r8   )r   r   )
r   lineofr@   rA   rE   rB   rC   rD   rF   rG   )rr   rH   rM   rZ   @py_assert8rz   rg   @py_format12@py_assert10@py_assert9@py_format14r   rY   r[   re   r{   @py_format13r   r   r   test_iniconfig_lineof   s    			         	         	         	          	          
 	      p   
 	      p   r   c              C   s  t  d d d }  |  j } d } d } | | |  } d } | | k } | st j d | f d | | f  d	 t j |  d
 d t j   k s t j |   r t j |   n d d t j |  d t j |  d t j |  d t j |  i } d d | i } t t j	 |    d  } } } } } } |  j } d } d } | | | d t
 }	 d }
 |	 |
 k } | svt j d | f d |	 |
 f  d t j |	  d t j |
  d
 d t j   k st j |   rt j |   n d d t j |  d t j |  d t j |  d d t j   k s8t j t
  rGt j t
  n d i } d  d | i } t t j	 |    d  } } } }	 } }
 d  S)!Nr    r   z[section]
int = 1
float = 1.1r"   intr$   r8   S%(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s.get
}(%(py4)s, %(py6)s)
} == %(py11)srX   r:   rr   r?   rT   r   r<   r=   assert %(py13)sr   convertr   d%(py9)s
{%(py9)s = %(py2)s
{%(py2)s = %(py0)s.get
}(%(py4)s, %(py6)s, convert=%(py7)s)
} == %(py12)src   r   ra   assert %(py14)sZpy14)r8   )r   r   )r8   )r   r   )r   getr@   rA   rE   rB   rC   rD   rF   rG   r   )rr   rH   rM   rZ   rz   r   r   r   r   r   @py_assert11r   Z@py_format15r   r   r   test_iniconfig_get_convert   s.    	          	          r   c              C   sw  t  d d d }  |  j } d } d } d } | | | d | } d } | | k } | s4t j d | f d | | f  d
 t j |  d d t j   k s t j |   r t j |   n d d t j |  d t j |  d t j |  d t j |  d t j |  i } d d | i }	 t t j	 |	    d  } } } } } } } |  j } d } d } | | |  } d  }
 | |
 k } | sYt j d | f d | |
 f  d
 t j |  d d t j   k st j |   rt j |   n d d t j |  d t j |  d t j |
  d t j |  i } d d | i } t t j	 |    d  } } } } } }
 d  S)Nr    r   z[section]
int = 1
float = 1.1r"   r   r   defaultr8   f%(py10)s
{%(py10)s = %(py2)s
{%(py2)s = %(py0)s.get
}(%(py4)s, %(py6)s, default=%(py8)s)
} == %(py13)srX   r:   rr   r?   rT   ru   r   r<   r=   assert %(py15)sZpy15r   S%(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s.get
}(%(py4)s, %(py6)s)
} is %(py11)sr   assert %(py13)s)r8   )r   r   )r   )r   r   )
r   r   r@   rA   rE   rB   rC   rD   rF   rG   )rr   rH   rM   rZ   rz   r   Z@py_assert12r   r   Z@py_format16r   r   r   r   r   test_iniconfig_get_missing   s0    	           	          r   c              C   s  t  d d d }  |  d } | j } d } | | d t } d } | | k } | sGt j d | f d | | f  d
 d t j   k s t j |  r t j |  n d d t j |  d t j |  d d t j   k s t j t  r t j t  n d d t j |  d t j |  i } d d | i } t	 t j
 |    d  } } } } } | j } d } d }	 | | |	  }
 d } |
 | k } | sdt j d  | f d! |
 | f  d t j |
  d
 d t j   k st j |  rt j |  n d d t j |  d t j |	  d t j |  d t j |  i } d" d | i } t	 t j
 |    d  } } }	 }
 } } | j } d } d }	 | | |	  }
 d } |
 | k } | st j d# | f d$ |
 | f  d t j |
  d
 d t j   k st j |  rt j |  n d d t j |  d t j |	  d t j |  d t j |  i } d% d | i } t	 t j
 |    d  } } }	 }
 } } d  S)&Nr    r   z[section]
value=1r"   r#   r   r   r8   [%(py7)s
{%(py7)s = %(py2)s
{%(py2)s = %(py0)s.get
}(%(py4)s, convert=%(py5)s)
} == %(py10)sr:   r?   ru   rq   r   r<   ra   r=   assert %(py12)sr   r$   S%(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s.get
}(%(py4)s, %(py6)s)
} == %(py11)srX   rT   r   assert %(py13)sr   r   r&   )r8   )r   r   )r8   )r   r   )r8   )r   r   )r   r   r   r@   rA   rB   rC   rD   rE   rF   rG   )rr   r"   rH   rM   re   r   r   r{   r   rZ   rz   r   r   r   r   r   r   test_section_get   sD    
	         	          	          r   c              C   s)   t  d d d }  t j j t d  d  S)Nr    r   z[section]
value=1zconfig["other"])r   r4   r5   r6   KeyError)rr   r   r   r   test_missing_section   s    r   c              C   sN  t  d d d }  |  d d } d } | | k } | s t j d | f d | | f  d	 t j |  d
 t j |  i } d d | i } t t j |    d  } } } |  d d } d } | | k } | s<t j d | f d | | f  d	 t j |  d
 t j |  i } d d | i } t t j |    d  } } } d  S)Nr    r   z[section]
value=1r"   r#   r$   r8   %(py1)s == %(py4)sr?   rR   r=   assert %(py6)srT   )r8   )r   r   )r8   )r   r   )r   r@   rA   rE   rF   rG   )rr   r   rM   rY   rI   r\   r   r   r   test_section_getitem   s"        C       C   r   c              C   s  t  d d d }  t |  d  } d g } | | k } | s t j d | f d | | f  d d	 t j   k s t j |  r t j |  n d	 d
 t j |  i } d d | i } t t j	 |    d  } } t |  d j
    } d g } | | k } | st j d | f d | | f  d d t j   k sIt j |  rXt j |  n d d
 t j |  i } d d | i } t t j	 |    d  } } d  S)Nr    r   z[section]
value=1r"   r#   r8   %(py0)s == %(py3)sr:   r   rV   r=   assert %(py5)srq   r$   r   )r8   )r   r   )zvaluer$   )r8   )r   r   )r   rs   r@   rA   rB   rC   rD   rE   rF   rG   r   )rr   r   rY   rH   rN   @py_format6r   r   r   r   test_section_iter   s"    	   j   
	   j   r   c        
   
   C   s  t  d d t d  }  t |   } t |  } d } | | k } | st j d | f d | | f  d d t j   k s t j |  r t j	 |  n d d	 t j	 |  d
 d t j   k s t j t  r t j	 t  n d d t j	 |  i } d d | i } t
 t j |    d  } } } | d } | j } d } | | k } | st j d | f d | | f  d t j	 |  d	 t j	 |  d t j	 |  i } d  d | i } t
 t j |    d  } } } } | d d } d } | | k } | slt j d! | f d" | | f  d t j	 |  d t j	 |  i }	 d# d	 |	 i } t
 t j |    d  } } } | d } | j } d } | | k } | st j d$ | f d% | | f  d t j	 |  d	 t j	 |  d t j	 |  i } d& d | i } t
 t j |    d  } } } } | d d } d } | | k } | st j d' | f d( | | f  d t j	 |  d t j	 |  i }	 d) d	 |	 i } t
 t j |    d  } } } d  S)*Nzx.inir   zS
          [section1]
          value=1
          [section2]
          value=2
    r&   r8   0%(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)srR   lrT   r:   lenrV   r=   assert %(py8)srX   r   section1,%(py3)s
{%(py3)s = %(py1)s.name
} == %(py6)sr#   r$   %(py1)s == %(py4)sr?   assert %(py6)sr   r   2)r8   )r   r   )r8   )r   r   )r8   )r   r   )r8   )r   r   )r8   )r   r   )r   r   rs   r   r@   rA   rB   rC   rD   rE   rF   rG   r   )
rr   r   rY   rZ   r[   r\   r]   r   rM   rI   r   r   r   test_config_iter   sZ           
 	    R       C   
 	    R       C   r   c              C   s/  t  d d t d  }  d } | |  k } | s t j d | f d | |  f  d t j |  d d	 t j   k s t j |   r t j |   n d	 i } d d | i } t t j	 |    d  } } d } | |  k } | spt j d | f d | |  f  d t j |  d d	 t j   k s2t j |   rAt j |   n d	 i } d d | i } t t j	 |    d  } } d } | |  k } | s!t j d | f d | |  f  d t j |  d d	 t j   k st j |   rt j |   n d	 i } d d | i } t t j	 |    d  } } d  S)Nzx.inir   zS
          [section1]
          value=1
          [section2]
          value=2
    Zxyznot in%(py1)s not in %(py3)srR   rV   rr   r=   assert %(py5)srq   r   r   %(py1)s in %(py3)sr   )r   )r   r   )r   )r   r   )r   )r   r   )
r   r   r@   rA   rE   rB   rC   rD   rF   rG   )rr   r   rY   rN   r   r   r   r   test_config_contains   s.       j   
   j   
   j   r   c           
   C   s  t  d d d }  t |   } d d   | D } d d g } | | k } | s t j d | f d | | f  d
 d t j   k s t j |  r t j |  n d d t j |  i } d d | i } t t j	 |    d  } } |  d } t |  } d d g } | | k }	 |	 st j d |	 f d | | f  d t j |  d
 d t j   k smt j t  r|t j t  n d d t j |  d t j |  i }
 d  d |
 i } t t j	 |    d  } } }	 } |  d } t |  } d d g } | | k }	 |	 st j d! |	 f d" | | f  d t j |  d
 d t j   k s`t j t  rot j t  n d d t j |  d t j |  i }
 d# d |
 i } t t j	 |    d  } } }	 } d  S)$Nzx.inir   zx
[section2] #cpython dict ordered before section
value = 1
value2 = 2 # dict ordered before value
[section]
a = 1
b = 2
c             S   s   g  |  ] } | j   q Sr   )r   ).0r    r   r   r   
<listcomp>  s   	 z(test_iter_file_order.<locals>.<listcomp>r   r"   r8   %(py0)s == %(py3)sr:   secnamesrV   r=   assert %(py5)srq   r#   Zvalue20%(py4)s
{%(py4)s = %(py0)s(%(py2)s)
} == %(py7)sr?   rs   r<   ra   assert %(py9)src   ab)r8   )r   r   )r8   )r   r   )r8   )r   r   )
r   rs   r@   rA   rB   rC   rD   rE   rF   rG   )rr   r   r   rY   rH   rN   r   rM   re   rZ   rf   rg   r   r   r   test_iter_file_order   s:    		   j   

        
        r   c           
   C   s  t  d d t d  }  t |   \ } } } | d } d } | | k } | s t j d | f d | | f  d t j |  d	 t j |  i } d d | i } t t j |    d  } } } | d } d } | | k } | sOt j d | f d | | f  d t j |  d	 t j |  i } d d | i } t t j |    d  } } } | d } d } | | k } | st j d | f d  | | f  d t j |  d	 t j |  i } d! d | i } t t j |    d  } } } | d } d } | | k } | st j d" | f d# | | f  d t j |  d	 t j |  i } d$ d | i } t t j |    d  } } } d d d g } t |  }	 | |	 k } | st j d% | f d& | |	 f  d d t j	   k st j
 |  rt j |  n d d	 t j |  d t j |	  d d t j	   k sPt j
 t  r_t j t  n d i } d' d | i }
 t t j |
    d  } } }	 d  S)(NZpypircr   a:  
        [distutils]
        index-servers =
            pypi
            other

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

        [other]
        repository: http://example.com/pypi
        username: <username>
        password: <password>
    zindex-serversz
pypi
otherr8   %(py1)s == %(py4)sr?   rR   r=   assert %(py6)srT   Z
repositoryz<repository-url>usernamez
<username>passwordz
<password>0%(py1)s == %(py6)s
{%(py6)s = %(py3)s(%(py4)s)
}otherrV   rs   assert %(py8)srX   )r8   )r   r   )r8   )r   r   )r8   )r   r   )r8   )r   r   )r8   )r   r   )r   r   rs   r@   rA   rE   rF   rG   rB   rC   rD   )rr   Z	distutilsZpypir   r   rM   rY   rI   r\   rZ   r]   r   r   r   test_example_pypirc  sV    
    C   
    C   
    C   
    C          r   c              C   s   d d g }  t  |  k } | s t j d | f d t  |  f  d d t j   k s` t j t   ro t j t   n d d t j |   i } d d
 | i } t t j |    d  } }  d  S)Nr   r   r8   %(py0)s == %(py3)sr:   ALLrV   r=   assert %(py5)srq   )r8   )r   r   )	r   r@   rA   rB   rC   rD   rE   rF   rG   )rY   rH   rN   r   r   r   r   test_api_import  s       j   r   z#qwez  #qwez;qwez ;qwec             C   s   t  |   } | s d d d d t j   k s= t j |   rL t j |   n d d d t j   k ss t j t   r t j t   n d d t j |  i } t t j |    d  } d  S)Nr=   z,assert %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
}rR   rm   r:   r   rV   )r   rB   rC   r@   rD   rE   rF   rG   )rm   rY   rN   r   r   r   test_iscommentline_true"  s
        r   )r   sectionNN)r   Nvaluer$   )r   r   NN)r   r   r   r$   )r   Nnamesr%   )r   Nr   r%   )r   r   NN)r&   r   r   r$   )r   Nr   r$   )r   r   NN)r   r   NN)r   Nnamer(   )r   Nr   r)   )r   Nr   r!   )r   Nr   r*   )r   Nr   r+   )1builtinsrB   _pytest.assertion.rewrite	assertionrewriter@   r4   pytestZpy._iniconfigr   r   r   r   r   textwrapr   r   r   r   r3   r7   rJ   rO   r^   rh   rk   rl   r5   markr   rn   r|   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   parametrizer   r   r   r   r   <module>   s     											
