o
    N!wZë  ã                   @   sJ   d Z zddlZW n ey   ddlZY nw dd„ ZG dd„ dejƒZdS )z5Implementations of unittest features from the future.é    Nc                 C   s   t tj| ƒS )z/Does `unittest.TestCase` have `method` defined?)ÚhasattrÚunittestÚTestCase)Úmethod© r   úG/var/www/html/env/lib/python3.10/site-packages/coverage/backunittest.pyÚunittest_has   s   r   c                   @   s<   e Zd ZdZdd„ Zedƒsdd„ Zedƒsdd	„ Zd
S d
S )r   z²Just like unittest.TestCase, but with assert methods added.

    Designed to be compatible with 3.1 unittest.  Methods are only defined if
    `unittest` doesn't have them.

    c                 C   s   |   t|ƒt|ƒ¡ dS )z9Assert these have the same elements, regardless of order.N)ÚassertEqualÚsorted)ÚselfÚs1Ús2r   r   r   ÚassertCountEqual    s   zTestCase.assertCountEqualÚassertRaisesRegexc                 O   ó   | j |i |¤ŽS ©N)ÚassertRaisesRegexp©r   ÚargsÚkwargsr   r   r   r   %   ó   zTestCase.assertRaisesRegexÚassertRegexc                 O   r   r   )ÚassertRegexpMatchesr   r   r   r   r   )   r   zTestCase.assertRegexN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r   r      s    ÿr   )r   Ú	unittest2r   ÚImportErrorr   r   r   r   r   r   Ú<module>   s   ÿ