a
     ñ»jj]  ã                   @   sè  d dl Z d dlZd dlZd dlmZ d dlmZ zd dlmZm	Z	 W n" e
yf   dd„ Zdd„ Z	Y n0 d	d
lmZmZmZmZmZmZmZmZmZ dd„ Zdd„ Zeƒ Ze d¡ZedkZedkZeeeoÎeedœZeƒ Zd—dd„Zdd„ Zddddedƒeddd�gZ edg d ¢ƒ ee ƒd˜d!d"„ƒZ!G d#d$„ d$e"ƒZ#e�sPG d%d&„ d&e"ƒZ$d'd(„ Z%e &d)¡G d*d+„ d+eƒƒZ'e &d)¡G d,d-„ d-e"ƒƒZ(G d.d/„ d/eƒZ)G d0d1„ d1e"ƒZ*edd2gƒ edgƒe &d3¡d4d5„ ƒƒZ+ej&j,d6ej-d7�G d8d9„ d9eƒƒZ.edd:gƒ edgƒej&j,d6ej-ej-d;�d<d=„ ƒƒZ/G d>d?„ d?eƒZ0G d@dA„ dAeƒZ1dBdC„ Z2dDdE„ Z3dFdG„ Z4dHdI„ Z5edJdKgƒ edLdM„ ƒdNdO„ ƒZ6dPdQ„ Z7dRdS„ Z8dTdU„ Z9G dVdW„ dWƒZ:edXeƒ g fdYeƒ g fdYed	ddZ�d[d\d]difgfd]ed	ƒd^gfd_ed	ƒd^gfd_ed	d`ƒd^dagfdbed	d`d�d^d\dcd`ifgfddeƒ degfdded	ƒdfgfdged	ƒdfdhgfdged	diƒdfdjgfdged	didkƒg dl¢fdged	didm�dfdjgfdged	didn�dfdhd\dodiifgfdged	didkdkdn�dfdjdpd\dodkifgfgƒdqdr„ ƒZ;eg ds¢ƒd™dudv„ƒZ<edZgƒdwdx„ ƒZ=dydz„ e>d{ƒD ƒZ?ee?ƒd|d}„ ƒZ@ed~dd€gƒG d�d‚„ d‚eƒƒZAedƒd„d…gd†dM„ d‡�G dˆd‰„ d‰eƒƒZBed]didcdŠid‹dŒd�dŽœgƒG d�d�„ d�eƒƒZCG d‘d’„ d’e"ƒZDejEjFdkk�räejEjGd“k�räd d”lmHZH G d•d–„ d–eHƒZIdS )šé    N©Úwraps)ÚTestCase)Úassert_equalÚassert_raisesc                  O   s   t ƒ j| i |¤ŽS ©N)r   ZassertEqual©ÚargsÚkwds© r   ú8E:\soccer\ml_env\Lib\site-packages\parameterized/test.pyr      s    r   c                  O   s   t ƒ j| i |¤ŽS r   )r   ZassertRaisesr   r   r   r   r      s    r   é   )	ÚPY3ÚPY2ÚparameterizedÚparamÚ"parameterized_argument_value_pairsÚ
short_reprÚdetect_runnerÚparameterized_classÚSkipTestc                 C   s   || vrt d|| f ƒ‚d S )Nz%r not in %r)ÚAssertionError)ZhaystackÚneedler   r   r   Úassert_contains   s    r   c                    s   ‡ ‡fdd„}|S )a$  
    Assert that a wrapped `unittest.TestCase` method raises an error matching the given type and message regex.

    :param expected_exception: Exception class expected to be raised.
    :param expected_regexp: Regexp (re pattern object or string) expected to be found in error message.
    c                    s   t ˆ ƒ‡‡‡ fdd„ƒ}|S )Nc                    sF   |   ˆ ˆ¡�& ˆ| g|¢R i |¤Ž W d   ƒ n1 s80    Y  d S r   )ZassertRaisesRegexp)Úselfr	   Úkwargs)Úexpected_exceptionÚexpected_regexpÚfuncr   r   Úwrapper$   s    zGassert_raises_regexp_decorator.<locals>.func_decorator.<locals>.wrapperr   )r   r   ©r   r   ©r   r   Úfunc_decorator#   s    z6assert_raises_regexp_decorator.<locals>.func_decoratorr   )r   r   r"   r   r    r   Úassert_raises_regexp_decorator   s    r#   ÚunittestZnose2Úpytest)Ú	generatorÚ
standaloneZpy2nose2r%   c                 C   s<   |d u r| }d } t dd„ | pd ¡ D ƒƒr.d S t |¡ d S )Nc                 s   s   | ]}t  |¡V  qd S r   )Ú
SKIP_FLAGSÚget)Ú.0Úfr   r   r   Ú	<genexpr>C   ó    zexpect.<locals>.<genexpr>Ú )ÚanyÚsplitÚmissing_testsÚupdate)ÚskipÚtestsr   r   r   Úexpect?   s    r5   c                 C   sT   t | tƒs| g} t||ƒ}t ¡ jj}| D ]$}||v r*|| }||ƒ}|||< q*dS )a^  
    Assert that the given `unittest.TestCase` tests raise an error matching the given type and message regex.

    :param tests: A single test name or list of test names.
    :param expected_exception: Exception class expected to be raised.
    :param expected_regexp: Regexp (re pattern object or string) expected to be found in error message.
    N)Ú
isinstanceÚlistr#   ÚinspectÚcurrentframeÚf_backÚf_locals)r4   r   r   Ú	decoratorÚframe_localsÚtestÚtest_methodZdecorated_test_methodr   r   r   Úexpect_exception_matching_regexH   s    

r@   ©é*   Úfoo0s   baré{   Úfoo1Zfoo2rB   )Úbarr'   )z!test_naked_function(42, bar=None)z%test_naked_function('foo0', bar=None)z%test_naked_function(b'bar', bar=None)z"test_naked_function(123, bar=None)z%test_naked_function('foo1', bar=None)z#test_naked_function('foo2', bar=42)c                 C   s   t  d| |f ¡ d S )Nztest_naked_function(%r, bar=%r)©r1   Úremove)ÚfoorF   r   r   r   Útest_naked_functiono   s    rJ   c                   @   s,   e Zd Zedg d¢ƒ eeƒddd„ƒZdS )ÚTestParameterizedr&   )z"test_instance_method(42, bar=None)z&test_instance_method(b'bar', bar=None)z#test_instance_method(123, bar=None)z&test_instance_method('foo0', bar=None)z&test_instance_method('foo1', bar=None)z$test_instance_method('foo2', bar=42)Nc                 C   s   t  d||f ¡ d S )Nz test_instance_method(%r, bar=%r)rG   ©r   rI   rF   r   r   r   Útest_instance_method~   s    z&TestParameterized.test_instance_method)N)Ú__name__Ú
__module__Ú__qualname__r5   r   Útest_paramsrM   r   r   r   r   rK   t   s   	rK   c                   @   sJ   e Zd Zedg d¢ƒ g d¢ZdZdd„ Zdd„ Zed	d
gƒdd„ ƒZ	dS )ÚTestSetupTeardownr&   )ztest_setup(setup 1)zteardown_called(teardown 1)ztest_setup(setup 2)zteardown_called(teardown 2))zsetup 1z
teardown 1zsetup 2z
teardown 2zerror: setup not calledc                 C   s   | j  d¡| _d S )Nr   )ÚstackÚpopÚactual_order©r   r   r   r   ÚsetUp�   s    zTestSetupTeardown.setUpc                 C   s   t  d| j d¡f ¡ d S )Nzteardown_called(%s)r   )r1   rH   rS   rT   rV   r   r   r   ÚtearDown“   s    zTestSetupTeardown.tearDown©r   ©é   c                 G   s(   t | jd|f ƒ t d| jf ¡ d S )Nzsetup %sztest_setup(%s))r   rU   r1   rH   )r   ÚcountÚar   r   r   Ú
test_setup–   s    zTestSetupTeardown.test_setupN)
rN   rO   rP   r5   rS   rU   rW   rX   r   r^   r   r   r   r   rR   …   s   
rR   c                    s   ‡ fdd„}|S )Nc                    s"   |j d }| jdˆ   t |¡ S )Nr   z	_%s_name_)r	   rN   r   Úto_safe_name)Ztestcase_funcZ	param_numr   Úarg©Ú
custom_tagr   r   Úcustom_naming_func�   s    
z.custom_naming_func.<locals>.custom_naming_funcr   )rb   rc   r   ra   r   rc   œ   s    rc   z	os.getpidc                   @   s|   e Zd Zeg d¢ƒ e ddedƒg¡e d¡dd„ ƒƒZ	eg d¢ƒ e d	d
eddƒg¡e d¡e d¡dd„ ƒƒƒZ
dS )Ú,TestParameterizedExpandWithMockPatchForClass)z<test_one_function_patch_decorator('foo1', 'umask', 'getpid')z<test_one_function_patch_decorator('foo0', 'umask', 'getpid')z8test_one_function_patch_decorator(42, 'umask', 'getpid')rA   rC   rE   úos.umaskc                 C   s   t  d||j|jf ¡ d S )Nz-test_one_function_patch_decorator(%r, %r, %r)©r1   rH   Ú
_mock_name)r   rI   Ú
mock_umaskÚmock_getpidr   r   r   Ú!test_one_function_patch_decorator¬   s
    ÿÿzNTestParameterizedExpandWithMockPatchForClass.test_one_function_patch_decorator)zKtest_multiple_function_patch_decorator(42, 51, 'umask', 'fdopen', 'getpid')zStest_multiple_function_patch_decorator('foo0', 'bar0', 'umask', 'fdopen', 'getpid')zStest_multiple_function_patch_decorator('foo1', 'bar1', 'umask', 'fdopen', 'getpid')©rB   é3   ©rC   Zbar0Úbar1ú	os.fdopenc                 C   s"   t  d|||j|j|jf ¡ d S )Nz:test_multiple_function_patch_decorator(%r, %r, %r, %r, %r)rf   )r   rI   rF   rh   Úmock_fdopenri   r   r   r   Ú&test_multiple_function_patch_decorator¼   s
    ÿþzSTestParameterizedExpandWithMockPatchForClass.test_multiple_function_patch_decoratorN)rN   rO   rP   r5   r   Úexpandr   ÚmockÚpatchrj   rq   r   r   r   r   rd   ¤   s   	rd   c                   @   s4   e Zd Zeddgƒ edgƒe d¡dd„ ƒƒZdS )Ú#TestParameterizedExpandWithNoExpandr&   z5test_patch_class_no_expand(42, 51, 'umask', 'getpid')rk   re   c                 C   s   t  d|||j|jf ¡ d S )Nz*test_patch_class_no_expand(%r, %r, %r, %r)rf   )r   rI   rF   rh   ri   r   r   r   Útest_patch_class_no_expandÍ   s
    ÿþz>TestParameterizedExpandWithNoExpand.test_patch_class_no_expandN)rN   rO   rP   r5   r   rs   rt   rv   r   r   r   r   ru   Ç   s   ÿru   c                   @   sº   e Zd Zeg d¢ƒ e ddedƒg¡e d¡dd„ ƒƒZ	eg d¢ƒ e d	d
eddƒg¡e d¡e d¡dd„ ƒƒƒZ
eddgƒ e ddg¡e d¡dd„ ƒƒZeddgedd� dS )Ú.TestParameterizedExpandWithNoMockPatchForClass)z2test_one_function_patch_decorator('foo1', 'umask')z2test_one_function_patch_decorator('foo0', 'umask')z.test_one_function_patch_decorator(42, 'umask')rA   rC   rE   re   c                 C   s   t  d||jf ¡ d S )Nz)test_one_function_patch_decorator(%r, %r)rf   ©r   rI   rh   r   r   r   rj   Ý   s    ÿzPTestParameterizedExpandWithNoMockPatchForClass.test_one_function_patch_decorator)zAtest_multiple_function_patch_decorator(42, 51, 'umask', 'fdopen')zItest_multiple_function_patch_decorator('foo0', 'bar0', 'umask', 'fdopen')zItest_multiple_function_patch_decorator('foo1', 'bar1', 'umask', 'fdopen')rk   rm   rn   ro   c                 C   s   t  d|||j|jf ¡ d S )Nz6test_multiple_function_patch_decorator(%r, %r, %r, %r)rf   )r   rI   rF   rh   rp   r   r   r   rq   é   s
    ÿþzUTestParameterizedExpandWithNoMockPatchForClass.test_multiple_function_patch_decoratorz>test_patch_decorator_over_test_with_error('foo_this', 'umask')z>test_patch_decorator_over_test_with_error('foo_that', 'umask'))Zfoo_this)Zfoo_thatc                 C   s    t  d ||j¡¡ tdƒ‚d S )Nz5test_patch_decorator_over_test_with_error({!r}, {!r})z"This error should have been caught)r1   rH   Úformatrg   Ú
ValueErrorrx   r   r   r   Ú)test_patch_decorator_over_test_with_errorø   s    ÿzXTestParameterizedExpandWithNoMockPatchForClass.test_patch_decorator_over_test_with_errorZ4test_patch_decorator_over_test_with_error_0_foo_thisZ4test_patch_decorator_over_test_with_error_1_foo_thatz$^This error should have been caught$)r4   r   r   N)rN   rO   rP   r5   r   rr   r   rs   rt   rj   rq   r{   r@   rz   r   r   r   r   rw   Ö   s4   þþþúrw   c                   @   s4   e Zd Zeddgƒ edgƒe d¡dd„ ƒƒZdS )Ú6TestParameterizedExpandWithNoMockPatchForClassNoExpandr&   z%test_patch_no_expand(42, 51, 'umask')rk   re   c                 C   s   t  d|||jf ¡ d S )Nz test_patch_no_expand(%r, %r, %r)rf   )r   rI   rF   rh   r   r   r   Útest_patch_no_expand  s    
ÿzKTestParameterizedExpandWithNoMockPatchForClassNoExpand.test_patch_no_expandN)rN   rO   rP   r5   r   rs   rt   r}   r   r   r   r   r|     s   ÿr|   z0test_mock_patch_standalone_function(42, 'umask')re   c                 C   s   t  d| |jf ¡ d S )Nz+test_mock_patch_standalone_function(%r, %r)rf   )rI   rh   r   r   r   Ú#test_mock_patch_standalone_function  s
    ÿÿr~   Úos)Úumaskc                   @   sR   e Zd Zeddgƒ e dg¡ejjdej	d�dd„ ƒƒZ
e dg¡d	d
„ ƒZdS )Ú,TestParameterizedExpandWithMockPatchMultiplez@test_mock_patch_multiple_expand_on_method(42, 'umask', 'getpid')z5test_mock_patch_multiple_expand_on_class(16, 'umask')rA   r   )Úgetpidc                 C   s   t  d||j|jf ¡ d S )Nz5test_mock_patch_multiple_expand_on_method(%r, %r, %r)rf   )r   r   r€   r‚   r   r   r   Ú)test_mock_patch_multiple_expand_on_method-  s
    
ÿÿzVTestParameterizedExpandWithMockPatchMultiple.test_mock_patch_multiple_expand_on_method)é   c                 C   s   t  d||jf ¡ d S )Nz0test_mock_patch_multiple_expand_on_class(%r, %r)rf   )r   r   r€   r   r   r   Ú(test_mock_patch_multiple_expand_on_class6  s
    ÿÿzUTestParameterizedExpandWithMockPatchMultiple.test_mock_patch_multiple_expand_on_classN)rN   rO   rP   r5   r   rr   rs   rt   ÚmultipleÚDEFAULTrƒ   r…   r   r   r   r   r�   &  s   þ

r�   z:test_mock_patch_multiple_standalone(42, 'umask', 'getpid'))r€   r‚   c                 C   s   t  d| |j|jf ¡ d S )Nz/test_mock_patch_multiple_standalone(%r, %r, %r)rf   )r   r€   r‚   r   r   r   Ú#test_mock_patch_multiple_standaloneB  s
    
ÿÿrˆ   c                   @   sT   e Zd Zeg d¢ƒ e e¡d
dd„ƒZeg d¢ƒ ejeedƒd�ddd	„ƒZ	dS )ÚTestParamerizedOnTestCase)ztest_on_TestCase(42, bar=None)z"test_on_TestCase(b'bar', bar=None)ztest_on_TestCase(123, bar=None)z"test_on_TestCase('foo0', bar=None)z"test_on_TestCase('foo1', bar=None)z test_on_TestCase('foo2', bar=42)Nc                 C   s   t  d||f ¡ d S )Nztest_on_TestCase(%r, bar=%r)rG   rL   r   r   r   Útest_on_TestCaseW  s    z*TestParamerizedOnTestCase.test_on_TestCase)z.test_on_TestCase2_custom_name_42(42, bar=None)z6test_on_TestCase2_custom_name_b_bar_(b'bar', bar=None)z0test_on_TestCase2_custom_name_123(123, bar=None)z4test_on_TestCase2_custom_name_foo0('foo0', bar=None)z4test_on_TestCase2_custom_name_foo1('foo1', bar=None)z2test_on_TestCase2_custom_name_foo2('foo2', bar=42)Zcustom)Z	name_funcc                 C   sb   t  ¡ }|d }|d j}|d d j}dt |¡ }t||d||f ƒ t d|||f ¡ d S )Nr   r   r]   Ztest_on_TestCase2_custom_name_z>Test Method name '%s' did not get customized to expected: '%s'z%s(%r, bar=%r))	r8   rS   r;   Z_testMethodNamer   r_   r   r1   rH   )r   rI   rF   rS   Úframer=   Znose_test_method_nameZexpected_namer   r   r   Útest_on_TestCase2d  s    
ÿÿz+TestParamerizedOnTestCase.test_on_TestCase2)N)N)
rN   rO   rP   r5   r   rr   rQ   rŠ   rc   rŒ   r   r   r   r   r‰   M  s   		ÿr‰   c                   @   sÌ   e Zd Zddd„Zejedƒgdd„ d�dd	d
„ƒZe edƒg¡dd„ ƒZe edƒg¡dd„ ƒZ	e edƒg¡dd„ ƒZ
e edƒg¡dd„ ƒZe edƒg¡ddd„ƒZe edƒg¡ddd„ƒZdS )Ú TestParameterizedExpandDocstringFc                 C   sr   t  ¡ }|d d j}| d¡p@| d¡p@| d¡p@| d¡p@d}|du rRtdƒ‚|j}|rd| ¡ }t||ƒ dS )	zg Checks the current test method's docstring. Must be called directly
            from the test method. é   r   Z
testMethodÚfunctionÚmethodZtestfunctionNz-uh oh, unittest changed a local variable name)r8   rS   r;   r)   r   Ú__doc__Úrstripr   )r   Zexpected_docstringr’   rS   r;   r?   Zactual_docstringr   r   r   Ú_assert_docstrings  s"    
ÿþýûz2TestParameterizedExpandDocstring._assert_docstringrI   c                 C   s   dS )NÚstuffr   )r+   ÚnÚpr   r   r   Ú<lambda>‡  r-   z)TestParameterizedExpandDocstring.<lambda>)Zdoc_funcNc                 C   s   |   d¡ dS )ÚDocumentationr”   N©r“   rL   r   r   r   Útest_custom_doc_func†  s    z5TestParameterizedExpandDocstring.test_custom_doc_funcc                 C   s   |   d|f ¡ dS )zDocumentation.zDocumentation [with foo=%r].Nr™   ©r   rI   r   r   r   Útest_single_line_docstringŒ  s    z;TestParameterizedExpandDocstring.test_single_line_docstringc                 C   s   |   d|f ¡ dS )r.   z[with foo=%r]Nr™   r›   r   r   r   Útest_empty_docstring‘  s    z5TestParameterizedExpandDocstring.test_empty_docstringc                 C   s   |   d|f ¡ dS )zDocumentation.

        Morez*Documentation [with foo=%r].

        MoreNr™   r›   r   r   r   Útest_multiline_documentation–  s
    ÿÿz=TestParameterizedExpandDocstring.test_multiline_documentationc                 C   s   |   d|f ¡ dS )u   DÃ¶cumentation.u   DÃ¶cumentation [with foo=%r].Nr™   r›   r   r   r   Útest_unicode_docstring   s    z7TestParameterizedExpandDocstring.test_unicode_docstringé   c                 C   s   |   d||f ¡ dS )r˜   ú#Documentation [with foo=%r, bar=%r]Nr™   rL   r   r   r   Ú%test_default_values_get_correct_value¥  s    zFTestParameterizedExpandDocstring.test_default_values_get_correct_valuec                 C   s   | j d||f dd� dS )z
        Documentation
        r¡   T)r’   Nr™   rL   r   r   r   Útest_with_leading_newlineª  s    z:TestParameterizedExpandDocstring.test_with_leading_newline)F)N)r    )r    )rN   rO   rP   r“   r   rr   r   rš   rœ   r�   rž   rŸ   r¢   r£   r   r   r   r   r�   r  s"   
ÿ


	
r�   c               
   C   sT   zG dd„ dt ƒ} W n2 tyF } ztt|ƒdƒ W Y d }~nd }~0 0 tdƒ‚d S )Nc                   @   s   e Zd Zedgƒdd„ ƒZdS )zctest_warns_when_using_parameterized_with_TestCase.<locals>.TestTestCaseWarnsOnBadUseOfParameterizedrA   c                 S   s   d S r   r   r›   r   r   r   Útest_in_subclass_of_TestCaseµ  s    z€test_warns_when_using_parameterized_with_TestCase.<locals>.TestTestCaseWarnsOnBadUseOfParameterized.test_in_subclass_of_TestCaseN)rN   rO   rP   r   r¤   r   r   r   r   Ú(TestTestCaseWarnsOnBadUseOfParameterized´  s   r¥   úparameterized.expandúExpected exception not raised)r   Ú	Exceptionr   Ústrr   )r¥   Úer   r   r   Ú1test_warns_when_using_parameterized_with_TestCase²  s
    $r«   c               
   C   sT   zt g ƒdd„ ƒ W n2 tyF }  ztt| ƒdƒ W Y d } ~ nd } ~ 0 0 tdƒ‚d S )Nc                   S   s   d S r   r   r   r   r   r   r—   À  r-   z<test_helpful_error_on_empty_iterable_input.<locals>.<lambda>úiterable is emptyr§   )r   rz   r   r©   r   ©rª   r   r   r   Ú*test_helpful_error_on_empty_iterable_input¾  s
    $r®   c                  C   s"   t g dd�dd„ ƒ} tt| ƒ d S )NT)Zskip_on_emptyc                   S   s   d S r   r   r   r   r   r   r—   Ç  r-   z2test_skip_test_on_empty_iterable.<locals>.<lambda>)r   r   r   r!   r   r   r   Ú test_skip_test_on_empty_iterableÆ  s    r¯   c               
   C   sT   zG dd„ dt ƒ} W n2 tyF } ztt|ƒdƒ W Y d }~nd }~0 0 tdƒ‚d S )Nc                   @   s   e Zd Ze g ¡dd„ ƒZdS )zRtest_helpful_error_on_empty_iterable_input_expand.<locals>.ExpectErrorOnEmptyInputc                 S   s   d S r   r   rV   r   r   r   Útest_expect_errorÎ  s    zdtest_helpful_error_on_empty_iterable_input_expand.<locals>.ExpectErrorOnEmptyInput.test_expect_errorN)rN   rO   rP   r   rr   r°   r   r   r   r   ÚExpectErrorOnEmptyInputÍ  s   r±   r¬   r§   )r   rz   r   r©   r   )r±   rª   r   r   r   Ú1test_helpful_error_on_empty_iterable_input_expandË  s
    $r²   zstadalone generatorz"test_wrapped_iterable_input('foo')c                   C   s
   t dgƒS )NrI   )Úiterr   r   r   r   r—   Ú  r-   r—   c                 C   s   t  d| f ¡ d S )Nztest_wrapped_iterable_input(%r)rG   ©rI   r   r   r   Útest_wrapped_iterable_inputÚ  s    rµ   c               
   C   sX   zt dd„ ƒdd„ ƒ W n2 tyJ }  ztt| ƒdƒ W Y d } ~ nd } ~ 0 0 tdƒ‚d S )Nc                   S   s   dS )NrB   r   r   r   r   r   r—   à  r-   z:test_helpful_error_on_non_iterable_input.<locals>.<lambda>c                   S   s   d S r   r   r   r   r   r   r—   à  r-   zis not iterabler§   )r   r¨   r   r©   r   r­   r   r   r   Ú(test_helpful_error_on_non_iterable_inputÞ  s
    $r¶   c                  C   s   t ttƒƒ} t| g ƒ d S r   )Úsortedr7   r1   r   )Úmissingr   r   r   ÚtearDownModuleç  s    r¹   c               
   C   sˆ   t rtdƒ‚G dd„ dƒ} zt| ƒ  ¡ ƒ W nN tyz } z6tt|ƒdƒ tt|ƒdƒ tt|ƒdƒ W Y d }~nd }~0 0 tdƒ‚d S )Nz"Py3 doesn't have old-style classesc                   @   s   e Zd Zedgƒdd„ ƒZdS )z-test_old_style_classes.<locals>.OldStyleClassrI   c                 S   s   d S r   r   ©r   r   r   r   r   Úparameterized_methodï  s    zBtest_old_style_classes.<locals>.OldStyleClass.parameterized_methodN)rN   rO   rP   r   r»   r   r   r   r   ÚOldStyleClassî  s   r¼   z	new-styler¦   z0expected TypeError not raised by old-style class)r   r   r7   r»   Ú	TypeErrorr   r©   r   )r¼   rª   r   r   r   Útest_old_style_classesë  s    $r¾   c                   @   s0   e Zd Zedddgƒ e ddg¡dd„ ƒZdS )	ÚTestOldStyleClasszpy2nose2 generatorztest_on_old_style_class('foo')ztest_on_old_style_class('bar')rI   rF   c                 C   s   t  d|f ¡ d S )Nztest_on_old_style_class(%r)rG   rº   r   r   r   r¾     s    z(TestOldStyleClass.test_old_style_classesN)rN   rO   rP   r5   r   rr   r¾   r   r   r   r   r¿   ü  s   þr¿   r.   z*a, **kwr´   )ú*arY   z**kwrI   )rI   r   zfoo, *aé	   )rÀ   )rÁ   zfoo, *a, **kwrF   zx=9)ÚxrÁ   ©rÂ   r   zx, y=9, *a, **kw)ÚyrÁ   r[   ©rÄ   r[   rŽ   )rÃ   rÅ   ©rÀ   )rŽ   )rÄ   )ÚzrÇ   rÆ   c                 C   s&   t d| f ƒ}t||ƒ}t||ƒ d S )Nzlambda %s: None)Úevalr   r   )Zfunc_paramsr–   ÚexpectedÚhelperÚactualr   r   r   Ú'test_parameterized_argument_value_pairs  s    
rÌ   ))Úabcdz'abcd')Z	123456789z	'12...89')éÍ[z	123...789)rÎ   z12...89é   é   c                 C   s   t t| |d�|ƒ d S )N)r•   )r   r   )ÚinputrÉ   r•   r   r   r   Útest_short_repr  s    rÒ   c                 C   s   dS )z Docstring! Nr   )rÑ   r   r   r   Útest_with_docstring'  s    rÓ   c                 C   s   g | ]}||d  f‘qS rY   r   )r*   Úir   r   r   Ú
<listcomp>/  r-   rÕ   é   c                 C   s   t | |d ƒ d S )Nr   )r   )rÑ   rÉ   r   r   r   Útest_cases_over_101  s    r×   )r]   ÚbÚc)rI   r   r[   )r   r   r[   c                   @   s8   e Zd Zeg d¢ƒ dd„ Zdd„ Zdd„ Zdd	„ Zd
S )ÚTestParameterizedClass)z7TestParameterizedClass_0_foo:test_method_a('foo', 1, 2)z7TestParameterizedClass_0_foo:test_method_b('foo', 1, 2)z>TestParameterizedClass_0_foo:testCamelCaseMethodC('foo', 1, 2)z/TestParameterizedClass_1:test_method_a(0, 1, 2)z/TestParameterizedClass_1:test_method_b(0, 1, 2)z6TestParameterizedClass_1:testCamelCaseMethodC(0, 1, 2)c                 C   sF   t | dƒsJ ‚t| j| j dƒ t d| jj|| j| j| jf ¡ d S )Nr]   rŽ   z%s:%s(%r, %r, %r))	Úhasattrr   rØ   rÙ   r1   rH   Ú	__class__rN   r]   )r   Z	test_namer   r   r   Ú_assertionsD  s    ûz"TestParameterizedClass._assertionsc                 C   s   |   d¡ d S )NÚtest_method_a©rÝ   rV   r   r   r   rÞ   O  s    z$TestParameterizedClass.test_method_ac                 C   s   |   d¡ d S )NÚtest_method_brß   rV   r   r   r   rà   R  s    z$TestParameterizedClass.test_method_bc                 C   s   |   d¡ d S )NÚtestCamelCaseMethodCrß   rV   r   r   r   rá   U  s    z+TestParameterizedClass.testCamelCaseMethodCN)rN   rO   rP   r5   rÝ   rÞ   rà   rá   r   r   r   r   rÚ   6  s
   	rÚ   )r]   rY   rZ   c                 C   s   d| j |d f S )Nz%s_custom_func_%sr]   )rN   )ÚclsÚidxÚattrsr   r   r   r—   \  r-   )Zclass_name_funcc                   @   s    e Zd Zeddgƒ dd„ ZdS )ÚTestNamedParameterizedClassz8TestNamedParameterizedClass_custom_func_1:test_method(1)z8TestNamedParameterizedClass_custom_func_2:test_method(2)c                 C   s   t  d| jj| jf ¡ d S )Nz%s:test_method(%r))r1   rH   rÜ   rN   r]   rV   r   r   r   r?   c  s    þz'TestNamedParameterizedClass.test_methodN)rN   rO   rP   r5   r?   r   r   r   r   rå   Y  s
   þrå   z
some stuffzother stuffz	some namer    )rF   ÚnamerI   c                       sD   e Zd Zeg d¢ƒ dZdZ‡ fdd„Z‡ fdd„Zdd	„ Z‡  Z	S )
ÚTestParameterizedClassDict)	z/TestParameterizedClassDict_0:setUp(42, 'empty')z5TestParameterizedClassDict_0:test_method(42, 'empty')z2TestParameterizedClassDict_0:tearDown(42, 'empty')z>TestParameterizedClassDict_1_some_stuff:setUp(0, 'some stuff')zDTestParameterizedClassDict_1_some_stuff:test_method(0, 'some stuff')zATestParameterizedClassDict_1_some_stuff:tearDown(0, 'some stuff')z?TestParameterizedClassDict_2_some_name:setUp(12, 'other stuff')zETestParameterizedClassDict_2_some_name:test_method(12, 'other stuff')zBTestParameterizedClassDict_2_some_name:tearDown(12, 'other stuff')r   Úemptyc                    s.   t t| ƒ ¡  t d| jj| j| jf ¡ d S )Nz%s:setUp(%r, %r))	Úsuperrç   rW   r1   rH   rÜ   rN   rI   rF   rV   ©rÜ   r   r   rW     s    ýz TestParameterizedClassDict.setUpc                    s.   t t| ƒ ¡  t d| jj| j| jf ¡ d S )Nz%s:tearDown(%r, %r))	ré   rç   rX   r1   rH   rÜ   rN   rI   rF   rV   rê   r   r   rX   ˆ  s    ýz#TestParameterizedClassDict.tearDownc                 C   s    t  d| jj| j| jf ¡ d S )Nz%s:test_method(%r, %r))r1   rH   rÜ   rN   rI   rF   rV   r   r   r   r?   ‘  s
    ýz&TestParameterizedClassDict.test_method)
rN   rO   rP   r5   rI   rF   rW   rX   r?   Ú__classcell__r   r   rê   r   rç   j  s   		rç   c                   @   s"   e Zd Ze ddg¡dd„ ƒZdS )ÚTestUnicodeDocstringZvalue1u
   vÃ¥lÃ¼Ã©Â¡c                 C   s   dS )uL    Ð­Ñ‚Ð¾ Ð´Ð¾Ðº-Ñ�Ñ‚Ñ€Ð¸Ð½Ð³, Ñ�Ð¾Ð´ÐµÑ€Ð¶Ð°Ñ‰Ð¸Ð¹ Ð½Ðµ-ascii Ñ�Ð¸Ð¼Ð²Ð¾Ð»Ñ‹ Nr   rº   r   r   r   rÓ   š  s    z(TestUnicodeDocstring.test_with_docstringN)rN   rO   rP   r   rr   rÓ   r   r   r   r   rì   ™  s
   þrì   é   )ÚIsolatedAsyncioTestCasec                   @   sZ   e Zd Zeg d¢ƒ e ddedƒg¡dd„ ƒZe ddedƒg¡e 	d¡dd	„ ƒƒZ
d
S )Ú3TestAsyncParameterizedExpandWithNoMockPatchForClass)ztest_one_async_function('foo1')ztest_one_async_function('foo0')ztest_one_async_function(42)z8test_one_async_function_patch_decorator('foo1', 'umask')z8test_one_async_function_patch_decorator('foo0', 'umask')z4test_one_async_function_patch_decorator(42, 'umask')rA   rC   rE   c                 Ã   s   t  d|f ¡ d S )Nztest_one_async_function(%r)rG   r›   r   r   r   Útest_one_async_function¯  s    zKTestAsyncParameterizedExpandWithNoMockPatchForClass.test_one_async_functionre   c                 Ã   s   t  d||jf ¡ d S )Nz/test_one_async_function_patch_decorator(%r, %r)rf   rx   r   r   r   Ú'test_one_async_function_patch_decorator³  s    ÿz[TestAsyncParameterizedExpandWithNoMockPatchForClass.test_one_async_function_patch_decoratorN)rN   rO   rP   r5   r   rr   r   rð   rs   rt   rñ   r   r   r   r   rï   ¥  s   	
rï   )N)N)rÐ   )Jr8   Úsysrs   Ú	functoolsr   r$   r   Z
nose.toolsr   r   ÚImportErrorr   r   r   r   r   r   r   r   r   r   r#   ÚrunnerÚ
startswithZUNITTESTZNOSE2ZPYTESTr(   Úsetr1   r5   r@   rQ   rJ   ÚobjectrK   rR   rc   rt   rd   ru   rw   r|   r~   r†   r‡   r�   rˆ   r‰   r�   r«   r®   r¯   r²   rµ   r¶   r¹   r¾   r¿   rÌ   rÒ   rÓ   ÚrangeZcases_over_10r×   rÚ   rå   rç   rì   Úversion_infoÚmajorÚminorrî   rï   r   r   r   r   Ú<module>   sô   ,
ú	
	
ú		"7ÿÿ	%@ÿ

	

$ñ

ÿ

þþý
ý*	