Ë
    Gï÷_Ã	  ã                   óT   — d dl mZmZmZmZ d dlmZ  G d„ de«      Z G d„ de«      Z	y)é    )ÚAnyÚCallableÚOptionalÚType)ÚTestCasec                   ó   — e Zd ZdZ	 dd„Zy)ÚHyperlinkTestCaseznThis type mostly exists to provide a backwards-compatible
    assertRaises method for Python 2.6 testing.
    Nc                 ób   — t        || «      }|€|S |5   ||i |¤Ž ddd«       y# 1 sw Y   yxY w)a�  Fail unless an exception of class expected_exception is raised
        by callableObj when invoked with arguments args and keyword
        arguments kwargs. If a different type of exception is
        raised, it will not be caught, and the test case will be
        deemed to have suffered an error, exactly as for an
        unexpected exception.

        If called with callableObj omitted or None, will return a
        context object used like this::

             with self.assertRaises(SomeException):
                 do_something()

        The context manager keeps a reference to the exception as
        the 'exception' attribute. This allows you to inspect the
        exception after the assertion::

            with self.assertRaises(SomeException) as cm:
                do_something()
            the_exception = cm.exception
            self.assertEqual(the_exception.error_code, 3)
        N)Ú_AssertRaisesContext)ÚselfÚexpected_exceptionÚcallableObjÚargsÚkwargsÚcontexts         ú7/usr/lib/python3/dist-packages/hyperlink/test/common.pyÚassertRaiseszHyperlinkTestCase.assertRaises
   sA   € ô< 'Ð'9¸4Ó@ˆØÐØˆNØñ 	)Ù˜Ð( Ò(÷	)÷ 	)ñ 	)ús   “	%¥.©N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   © ó    r   r	   r	      s   „ ñð ô")r   r	   c                   ó"   — e Zd ZdZd„ Zd„ Zd„ Zy)r   zCA context manager used to implement HyperlinkTestCase.assertRaises.c                 ó4   — || _         |j                  | _        y r   )ÚexpectedÚfailureException)r   r   Ú	test_cases      r   Ú__init__z_AssertRaisesContext.__init__2   s   € à ˆŒØ )× :Ñ :ˆÕr   c                 ó   — | S r   r   )r   s    r   Ú	__enter__z_AssertRaisesContext.__enter__7   s   € àˆr   c                 ó˜   — |€*| j                   j                  }| j                  |›d�«      ‚t        || j                   «      sy|| _        y)Nz not raisedFT)r   r   r   Ú
issubclassÚ	exception)r   Úexc_typeÚ	exc_valueÚtbÚexc_names        r   Ú__exit__z_AssertRaisesContext.__exit__;   sF   € àÐØ—}‘}×-Ñ-ˆHØ×'Ñ'º8Ð(EÓFÐFÜ˜( D§M¡MÔ2àØ"ˆŒØr   N)r   r   r   r   r    r"   r*   r   r   r   r   r   /   s   „ ÙIò;ò
ó	r   r   N)
Útypingr   r   r   r   Úunittestr   r	   Úobjectr   r   r   r   ú<module>r.      s'   ðß 0Ó 0Ý ô')˜ô ')ôT˜6õ r   