Current File : //usr/local/apps/python3/lib/python3.11/test/__pycache__/test_with.cpython-311.opt-1.pyc
�

�Keh��N�dZdZdZddlZddlZddlmZddlmZm	Z	m
Z
Gd�de��Zd	�ZGd
�de
��Zed���ZGd
�de
��ZGd�de��ZGd�dej��ZGd�de
��ZGd�deje��ZGd�deje��ZGd�deej��ZGd�dej��ZGd�dej��ZGd�d ej��ZGd!�d"ej��Zed#krej��dSdS)$z7Unit tests for the with statement specified in PEP 343.z
Mike Blandzmbland at acm dot org�N)�deque)�_GeneratorContextManager�contextmanager�nullcontextc�*��eZdZ�fd�Zd�Zd�Z�xZS)�MockContextManagerc�^��t��j|�d|_d|_d|_dS�NF)�super�__init__�enter_called�exit_called�	exit_args)�self�args�	__class__s  ��8/usr/local/apps/python3/lib/python3.11/test/test_with.pyrzMockContextManager.__init__s2��������$���!��� ��������c�8�d|_tj|��S�NT)r
r�	__enter__�rs rrzMockContextManager.__enter__s�� ���'�1�$�7�7�7rc�R�d|_|||f|_tj||||��Sr)rrr�__exit__�r�type�value�	tracebacks    rrzMockContextManager.__exit__s9�������y�1���'�0��t�16�	�C�C�	Cr)�__name__�
__module__�__qualname__rrr�
__classcell__)rs@rrr
s]������������8�8�8�C�C�C�C�C�C�Crrc����fd�}|S)Nc�&��t�||��S�N)r)r�kwds�funcs  �r�helperz#mock_contextmanager.<locals>.helper s���!�$��d�3�3�3r�)r'r(s` r�mock_contextmanagerr*s!���4�4�4�4�4��Mrc��eZdZd�ZdS)�MockResourcec�"�d|_d|_dSr
)�yielded�stoppedrs rrzMockResource.__init__&s���������rN�rr r!rr)rrr,r,%s#����������rr,c#�dK�t��}	d|_|V�d|_dS#d|_wxYwr)r,r.r/)�mocks r�mock_contextmanager_generatorr3+sB�����>�>�D������
�
�
�������t������s�&�	/c� �eZdZd�Zd�Zd�ZdS)�Nestedc�"�||_d|_dSr%)�managers�entered�rr7s  rrzNested.__init__7s�� ��
�����rc�<�|j�td���t��|_g}	|jD]C}|�|�����|j�|���Dn##|jtj	���s�YnxYw|S)NzContext is not reentrant)
r8�RuntimeErrorrr7�appendr�
appendleftr�sys�exc_info)r�vars�mgrs   rrzNested.__enter__;s����<�#��9�:�:�:��w�w�����	��}�
-�
-�����C�M�M�O�O�,�,�,���'�'��,�,�,�,�
-��	� �4�=�#�,�.�.�1�
��
�
�����s�AA9�9Bc���|}|jD])}	|j|�rd}�#tj��}Y�'xYwd|_||ur0|d|d���|d���dS)N�NNNr��)r8rr>r?�with_traceback)rr?�exrAs    rrzNested.__exit__Is������<�	$�	$�C�
$��3�<��$�,�+�B���
$��\�^�^����������
�X����"�Q�%��1��,�,�-�-�b��e�4�4�4��s��1N�rr r!rrrr)rrr5r55sA������������
5�
5�
5�
5�
5rr5c� �eZdZd�Zd�Zd�ZdS)�
MockNestedc�T�tj|g|�R�d|_d|_d|_dSr
)r5rr
rrr9s  rrzMockNested.__init__Zs5�����(�x�(�(�(�(�!��� �������rc�D�d|_t�|��Sr)r
r5rrs rrzMockNested.__enter__`s�� �������%�%�%rc�B�d|_||_tj|g|�R�Sr)rrr5r�rr?s  rrzMockNested.__exit__ds)�����!�����t�/�h�/�/�/�/rNrHr)rrrJrJYsA���������&�&�&�0�0�0�0�0rrJc�J�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�ZdS)�FailureTestCasec�B�d�}|�t|��dS)Nc�F�t5ddd��dS#1swxYwYdSr%��foor)rr�fooNotDeclaredz5FailureTestCase.testNameError.<locals>.fooNotDeclaredls0���N�N�N�N�N�N�N�N�N�N�N�N�N�N����N�N�N�N�N�Ns���)�assertRaises�	NameError)rrUs  r�
testNameErrorzFailureTestCase.testNameErrorks-��	�	�	����)�^�4�4�4�4�4rc�p��Gd�dt����fd�}|�td|��dS)Nc��eZdZd�ZdS)�<FailureTestCase.testEnterAttributeError1.<locals>.LacksEnterc��dSr%r)rs    rrzEFailureTestCase.testEnterAttributeError1.<locals>.LacksEnter.__exit__r����rN)rr r!rr)rr�
LacksEnterr[q�#������
�
�
�
�
rr^c�R�����}|5ddd��dS#1swxYwYdSr%r))rTr^s �r�
fooLacksEnterz?FailureTestCase.testEnterAttributeError1.<locals>.fooLacksEnterus<����*�,�,�C��N�N�N�N�N�N�N�N�N�N�N�N�N�N����N�N�N�N�N�N��� � �the context manager��object�assertRaisesRegex�	TypeError)rrar^s  @r�testEnterAttributeError1z(FailureTestCase.testEnterAttributeError1psg���	�	�	�	�	��	�	�	�	�	�	�	�	�	
���y�*?��O�O�O�O�Orc�p��Gd�dt����fd�}|�td|��dS)Nc��eZdZdS)�CFailureTestCase.testEnterAttributeError2.<locals>.LacksEnterAndExitN�rr r!r)rr�LacksEnterAndExitrk{s�������Drrmc�R�����}|5ddd��dS#1swxYwYdSr%r))rTrms �r�fooLacksEnterAndExitzFFailureTestCase.testEnterAttributeError2.<locals>.fooLacksEnterAndExit~s?���#�#�%�%�C��N�N�N�N�N�N�N�N�N�N�N�N�N�N����N�N�N�N�N�Nrbrcrd)rrorms  @r�testEnterAttributeError2z(FailureTestCase.testEnterAttributeError2zsh���	�	�	�	�	��	�	�	�	�	�	�	�	�	
���y�*?�AU�V�V�V�V�Vrc�p��Gd�dt����fd�}|�td|��dS)Nc��eZdZd�ZdS)�9FailureTestCase.testExitAttributeError.<locals>.LacksExitc��dSr%r)rs rrzCFailureTestCase.testExitAttributeError.<locals>.LacksExit.__enter__�r]rN)rr r!rr)rr�	LacksExitrs�r_rruc�R�����}|5ddd��dS#1swxYwYdSr%r))rTrus �r�fooLacksExitz<FailureTestCase.testExitAttributeError.<locals>.fooLacksExit�s<����)�+�+�C��N�N�N�N�N�N�N�N�N�N�N�N�N�N����N�N�N�N�N�Nrbzthe context manager.*__exit__rd)rrwrus  @r�testExitAttributeErrorz&FailureTestCase.testExitAttributeError�sg���	�	�	�	�	��	�	�	�	�	�	�	�	�	
���y�*I�<�X�X�X�X�Xrc�D�d�}|�t||��dS)Nc�(�t|dd��dS)N��single)�compile)�ss r�shouldRaiseSyntaxErrorzGFailureTestCase.assertRaisesSyntaxError.<locals>.shouldRaiseSyntaxError�s���A�r�8�$�$�$�$�$r)rV�SyntaxError)r�codestrrs   r�assertRaisesSyntaxErrorz'FailureTestCase.assertRaisesSyntaxError�s0��	%�	%�	%����+�'=�w�G�G�G�G�Grc�Z�|�d��|�d��dS)Nzwith mock as None:
  passzwith mock as (None):
  pass�r�rs r�testAssignmentToNoneErrorz)FailureTestCase.testAssignmentToNoneError�s>���$�$�%A�B�B�B��$�$�
�	�	�	�	�	rc�Z�|�d��|�d��dS)Nzwith mock as None,:
  passzwith mock as (None,):
  passr�rs r�,testAssignmentToTupleOnlyContainingNoneErrorz<FailureTestCase.testAssignmentToTupleOnlyContainingNoneError�s>���$�$�%B�C�C�C��$�$�
�	�	�	�	�	rc�0�|�d��dS)Nz%with mock as (foo, None, bar):
  passr�rs r�(testAssignmentToTupleContainingNoneErrorz8FailureTestCase.testAssignmentToTupleContainingNoneError�s)���$�$�
�	�	�	�	�	rc����Gd�dt�����fd�}��t|�����jd��dS)Nc��eZdZd�Zd�ZdS)�4FailureTestCase.testEnterThrows.<locals>.EnterThrowsc� �td���)NzEnter threw�r;rs rrz>FailureTestCase.testEnterThrows.<locals>.EnterThrows.__enter__�s��"�=�1�1�1rc��dSr%r)�rrs  rrz=FailureTestCase.testEnterThrows.<locals>.EnterThrows.__exit__�r]rN�rr r!rrr)rr�EnterThrowsr��s2������
2�
2�
2�
�
�
�
�
rr�c�l�����}d�_|5�_	ddd��dS#1swxYwYdSr%rS)�ctr�rs ��r�shouldThrowz4FailureTestCase.testEnterThrows.<locals>.shouldThrow�s��������B��D�H��
�t�x��
�
�
�
�
�
�
�
�
�
�
�
����
�
�
�
�
�
s�)�-�-)rerVr;�assertEqualrT)rr�r�s` @r�testEnterThrowszFailureTestCase.testEnterThrows�s�����	�	�	�	�	�&�	�	�	�	�	�	�	�	�	�
	
���,��4�4�4������4�(�(�(�(�(rc�n��Gd�dt����fd�}|�t|��dS)Nc��eZdZd�Zd�ZdS)�2FailureTestCase.testExitThrows.<locals>.ExitThrowsc��dSr%r)rs rrz<FailureTestCase.testExitThrows.<locals>.ExitThrows.__enter__�s���rc� �td���)N�*r�r�s  rrz;FailureTestCase.testExitThrows.<locals>.ExitThrows.__exit__�s��"�2�&�&�&rNr�r)rr�
ExitThrowsr��s2������
�
�
�
'�
'�
'�
'�
'rr�c�P�����5	ddd��dS#1swxYwYdSr%r))r�s�rr�z3FailureTestCase.testExitThrows.<locals>.shouldThrow�sv�������
�
��
�
�
�
�
�
�
�
�
�
�
�
����
�
�
�
�
�
s���)rerVr;)rr�r�s  @r�testExitThrowszFailureTestCase.testExitThrows�sd���	'�	'�	'�	'�	'��	'�	'�	'�
	�	�	�	�	�	
���,��4�4�4�4�4rN)
rr r!rXrhrprxr�r�r�r�r�r�r)rrrPrPjs�������5�5�5�
P�P�P�W�W�W�Y�Y�Y�H�H�H�
���������

)�
)�
)�	5�	5�	5�	5�	5rrPc�H�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z		dd	�Z
d
�ZdS)�ContextmanagerAssertionMixinc�.�td��|_dS)Nztest exception)r;�TEST_EXCEPTIONrs r�setUpz"ContextmanagerAssertionMixin.setUp�s��*�+;�<�<����rc��|�|j��|�|j��|�|jd��dSr%)�
assertTruer
�assertFalserr�r�r�mock_managers  r�assertInWithManagerInvariantsz:ContextmanagerAssertionMixin.assertInWithManagerInvariants�sM������1�2�2�2�����1�2�2�2�����/��6�6�6�6�6rc��|�|j��|�|j��|�|j|��dSr%)r�r
rr�r)rr�rs   r� assertAfterWithManagerInvariantsz=ContextmanagerAssertionMixin.assertAfterWithManagerInvariants�sK������1�2�2�2�����0�1�1�1�����/��;�;�;�;�;rc�2�|�|d��dS)NrC)r�r�s  r�'assertAfterWithManagerInvariantsNoErrorzDContextmanagerAssertionMixin.assertAfterWithManagerInvariantsNoError�s)���-�-�l��	 �	 �	 �	 �	 rc�n�|�|j��|�|j��dSr%)r�r.r�r/�r�mock_generators  r�assertInWithGeneratorInvariantsz<ContextmanagerAssertionMixin.assertInWithGeneratorInvariants�s4������.�/�/�/�����/�0�0�0�0�0rc�n�|�|j��|�|j��dSr%�r�r.r/r�s  r�)assertAfterWithGeneratorInvariantsNoErrorzFContextmanagerAssertionMixin.assertAfterWithGeneratorInvariantsNoError��2������.�/�/�/�����.�/�/�/�/�/rc��|j�r%)r�rs r�raiseTestExceptionz/ContextmanagerAssertionMixin.raiseTestException�s���!�!rNc��|�|j��|�|j��|�:|�|jd|j��t
|j��}|�|jd|��|�|jd|��|�|jdd��dS)NrDrrE)	r�r
rr�rr�r�assertIsInstance�assertIsNot)rr��exc_types   r�)assertAfterWithManagerInvariantsWithErrorzFContextmanagerAssertionMixin.assertAfterWithManagerInvariantsWithError�s�������1�2�2�2�����0�1�1�1������\�3�A�6��8K�L�L�L��D�/�0�0�H�����/��2�H�=�=�=����l�4�Q�7��B�B�B�����/��2�D�9�9�9�9�9rc�n�|�|j��|�|j��dSr%r�r�s  r�+assertAfterWithGeneratorInvariantsWithErrorzHContextmanagerAssertionMixin.assertAfterWithGeneratorInvariantsWithError�r�rr%)rr r!r�r�r�r�r�r�r�r�r�r)rrr�r��s�������=�=�=�7�7�7�
<�<�<�
 � � �1�1�1�0�0�0�"�"�"�<@�
:�
:�
:�
:�0�0�0�0�0rr�c�8�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	dS)	�NonexceptionalTestCasec�V�t��5	ddd��dS#1swxYwYdSr%�r3rs r�testInlineGeneratorSyntaxz0NonexceptionalTestCase.testInlineGeneratorSyntax�su��
*�
,�
,�	�	��	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s��"�"c��t��}|5	ddd��n#1swxYwY|�|��dSr%)r3r�)rr2s  r�testUnboundGeneratorz+NonexceptionalTestCase.testUnboundGenerator�s���,�.�.��
�	�	��	�	�	�	�	�	�	�	�	�	�	����	�	�	�	��4�4�T�:�:�:�:�:s��#�#c��t��5}|�|��ddd��n#1swxYwY|�|��dSr%�r3r�r��rrTs  r�testInlineGeneratorBoundSyntaxz5NonexceptionalTestCase.testInlineGeneratorBoundSyntax�s���
*�
,�
,�	6���0�0��5�5�5�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6����	6�	6�	6�	6�	
�6�6�s�;�;�;�;�;s�1�5�5c��d}t��5}|�|��ddd��n#1swxYwY|�|��dSr%r�r�s  r�*testInlineGeneratorBoundToExistingVariablezANonexceptionalTestCase.testInlineGeneratorBoundToExistingVariable�s�����
*�
,�
,�	6���0�0��5�5�5�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6����	6�	6�	6�	6��6�6�s�;�;�;�;�;s�3�7�7c���t��5|_|�|j��ddd��n#1swxYwY|�|j��dSr%)r3rTr�r�rs r�(testInlineGeneratorBoundToDottedVariablez?NonexceptionalTestCase.testInlineGeneratorBoundToDottedVariables���
*�
,�
,�	;����0�0���:�:�:�	;�	;�	;�	;�	;�	;�	;�	;�	;�	;�	;����	;�	;�	;�	;��6�6�t�x�@�@�@�@�@s
� ;�?�?c��t��}|5}|�|��|�|��ddd��n#1swxYwY|�|��|�|��dSr%)r3r�r�r�r�)rr2rTs   r�testBoundGeneratorz)NonexceptionalTestCase.testBoundGenerators���,�.�.��
�	5�S��0�0��5�5�5��.�.�t�4�4�4�	5�	5�	5�	5�	5�	5�	5�	5�	5�	5�	5����	5�	5�	5�	5�	
�6�6�s�;�;�;��4�4�T�:�:�:�:�:s�+A�A�Ac�J�t��}|5}t��}|5}|�|��|�|��|�|��|�|��ddd��n#1swxYwY|�|��|�|��|�|��|�|��ddd��n#1swxYwY|�|��|�|��dSr%)r3r�r�r�r�)r�mock_arT�mock_b�bars     r�testNestedSingleStatementsz1NonexceptionalTestCase.testNestedSingleStatementss���.�0�0��
�
	6�s�2�4�4�F��
:�3��2�2�6�:�:�:��2�2�6�:�:�:��4�4�S�9�9�9��4�4�S�9�9�9�	
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:����
:�
:�
:�
:�

�8�8��@�@�@��:�:�3�?�?�?��.�.�v�6�6�6��0�0��5�5�5�
	6�
	6�
	6�
	6�
	6�
	6�
	6�
	6�
	6�
	6�
	6����
	6�
	6�
	6�
	6�	
�4�4�V�<�<�<��6�6�s�;�;�;�;�;s6�C.�AB�7C.�B	�C.�
B	�AC.�.C2�5C2N)
rr r!r�r�r�r�r�r�r�r)rrr�r��s����������;�;�;�<�<�<�<�<�<�A�A�A�
;�;�;�<�<�<�<�<rr�c�8�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	dS)	�NestedNonexceptionalTestCasec�p�tt����5	ddd��dS#1swxYwYdSr%�r5r3rs r�"testSingleArgInlineGeneratorSyntaxz?NestedNonexceptionalTestCase.testSingleArgInlineGeneratorSyntax#s~��
�1�3�3�
4�
4�	�	��	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s�+�/�/c���t��}t|��5}|�|��ddd��n#1swxYwY|�|��dSr%�r3r5r�r��r�mrTs   r�testSingleArgBoundToNonTuplez9NestedNonexceptionalTestCase.testSingleArgBoundToNonTuple's���)�+�+���A�Y�Y�	2�#��.�.�q�1�1�1�	2�	2�	2�	2�	2�	2�	2�	2�	2�	2�	2����	2�	2�	2�	2��4�4�Q�7�7�7�7�7��A�A�Ac���t��}t|��5}|�|��ddd��n#1swxYwY|�|��dSr%r�r�s   r�2testSingleArgBoundToSingleElementParenthesizedListzONestedNonexceptionalTestCase.testSingleArgBoundToSingleElementParenthesizedList/s���)�+�+���A�Y�Y�	2�3��.�.�q�1�1�1�	2�	2�	2�	2�	2�	2�	2�	2�	2�	2�	2����	2�	2�	2�	2��4�4�Q�7�7�7�7�7r�c�B�d�}|�t|��dS)Nc�v�tt����5\}}	ddd��dS#1swxYwYdSr%r�)rTr�s  r�shouldThrowValueErrorziNestedNonexceptionalTestCase.testSingleArgBoundToMultipleElementTupleError.<locals>.shouldThrowValueError8s���5�7�7�8�8�
�J�S�#��
�
�
�
�
�
�
�
�
�
�
�
����
�
�
�
�
�
s�.�2�2)rV�
ValueError)rr�s  r�-testSingleArgBoundToMultipleElementTupleErrorzJNestedNonexceptionalTestCase.testSingleArgBoundToMultipleElementTupleError7s0��	�	�	�	
���*�&;�<�<�<�<�<rc��t��}t|��}|5|�|��|�|��ddd��n#1swxYwY|�|��|�|��dSr%�r3rJr�r�)rr*�mock_nesteds   r�testSingleArgUnboundz1NestedNonexceptionalTestCase.testSingleArgUnbound=s���;�=�=�� �!4�5�5��
�	<�	<��.�.�/B�C�C�C��.�.�{�;�;�;�	<�	<�	<�	<�	<�	<�	<�	<�	<�	<�	<����	<�	<�	<�	<�	
�4�4�5H�I�I�I��4�4�[�A�A�A�A�As�+A�A�Ac��t��}t��}t��}t|||��}|5|�|��|�|��|�|��|�|��ddd��n#1swxYwY|�|��|�|��|�|��|�|��dSr%r�)rr��n�or�s     r�testMultipleArgUnboundz3NestedNonexceptionalTestCase.testMultipleArgUnboundFs7��)�+�+��)�+�+��)�+�+�� ��A�q�)�)��
�	<�	<��.�.�q�1�1�1��.�.�q�1�1�1��.�.�q�1�1�1��.�.�{�;�;�;�		<�	<�	<�	<�	<�	<�	<�	<�	<�	<�	<����	<�	<�	<�	<�
	
�4�4�Q�7�7�7��4�4�Q�7�7�7��4�4�Q�7�7�7��4�4�[�A�A�A�A�As�AB�B#�&B#c��tt��t��t����}|5\}}}|�|��|�|��|�|��|�|��ddd��n#1swxYwY|�|��|�|��|�|��|�|��dSr%)rJr3r�r�r�r�)rr�r�r�r�s     r�testMultipleArgBoundz1NestedNonexceptionalTestCase.testMultipleArgBoundUs4�� �!>�!@�!@�)�+�+�-J�-L�-L�N�N��
�	<�I�Q��1��0�0��3�3�3��0�0��3�3�3��0�0��3�3�3��.�.�{�;�;�;�		<�	<�	<�	<�	<�	<�	<�	<�	<�	<�	<����	<�	<�	<�	<�
	
�6�6�q�9�9�9��6�6�q�9�9�9��6�6�q�9�9�9��4�4�[�A�A�A�A�As�AB�B!�$B!N)
rr r!r�r�r�r�r�r�r�r)rrr�r�!s����������8�8�8�8�8�8�=�=�=�B�B�B�
B�
B�
B�B�B�B�B�Brr�c�V�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
S)�ExceptionalTestCasec�����t�����fd�}��t|����������j��dS)Nc�����5�_��������j������ddd��dS#1swxYwYdSr%)�resourcer�r�r���cmrs��rr�z;ExceptionalTestCase.testSingleResource.<locals>.shouldThrowfs�����
*�t�}��2�2�2�6�6�6��4�4�T�]�C�C�C��'�'�)�)�)�
*�
*�
*�
*�
*�
*�
*�
*�
*�
*�
*�
*����
*�
*�
*�
*�
*�
*s�A	A�A�!A)r3rVr;r�r�r��rr�r�s` @r�testSingleResourcez&ExceptionalTestCase.testSingleResourcedsu����
*�
,�
,��	*�	*�	*�	*�	*�	*�
	
���,��4�4�4��6�6�r�:�:�:��8�8���G�G�G�G�Grc����t�����fd�}��t|�����t��dS)Nc�R���5�_ddzddd��dS#1swxYwYdS�NrDr)r�r�s��rr�z@ExceptionalTestCase.testExceptionNormalized.<locals>.shouldThrowqsw����
�t�}��Q���
�
�
�
�
�
�
�
�
�
�
�
����
�
�
�
�
�
s�� � )r3rV�ZeroDivisionErrorr�r�s` @r�testExceptionNormalizedz+ExceptionalTestCase.testExceptionNormalizedosc����
*�
,�
,��	�	�	�	�	�	�
	
���+�[�9�9�9��6�6�r�;L�M�M�M�M�Mrc�D����t���t������fd�}��t|���������������j�����j��dS)Nc�j���5�_�5�_�������������j�����j������ddd��n#1swxYwYddd��dS#1swxYwYdSr%�rTr�r�r�r��r�r�rs���rr�zCExceptionalTestCase.testNestedSingleStatements.<locals>.shouldThrow|s,����
.�4�8��.�t�x��6�6�v�>�>�>��6�6�v�>�>�>��8�8���B�B�B��8�8���B�B�B��+�+�-�-�-�.�.�.�.�.�.�.�.�.�.�.����.�.�.�.�
.�
.�
.�
.�
.�
.�
.�
.�
.�
.�
.�
.����
.�
.�
.�
.�
.�
.s5�B(�A8B�B(�B	�B(�B	�B(�(B,�/B,)r3rVr;r�r�rTr��rr�r�r�s` @@rr�z.ExceptionalTestCase.testNestedSingleStatementsys������.�0�0��.�0�0��	.�	.�	.�	.�	.�	.�	.�	
���,��4�4�4��6�6�v�>�>�>��6�6�v�>�>�>��8�8���B�B�B��8�8���B�B�B�B�Brc������t���t���t���������fd�}��t|��������������������j�����j��dS)Nc�f���5\�_�_������������������j�����j������ddd��dS#1swxYwYdSr%)�
resource_a�
resource_br�r�r�)�cm_a�cm_br�rs����rr�zOExceptionalTestCase.testMultipleResourcesInSingleStatement.<locals>.shouldThrow�s�����
*� B���$�/��2�2�4�8�8�8��2�2�4�8�8�8��2�2�;�?�?�?��4�4�T�_�E�E�E��4�4�T�_�E�E�E��'�'�)�)�)�

*�
*�
*�
*�
*�
*�
*�
*�
*�
*�
*�
*����
*�
*�
*�
*�
*�
*s�BB&�&B*�-B*)r3rJrVr;r�r�rr	)rr�r
rr�s` @@@r�&testMultipleResourcesInSingleStatementz:ExceptionalTestCase.testMultipleResourcesInSingleStatement�s�������,�.�.��,�.�.�� ��t�,�,��	*�	*�	*�	*�	*�	*�	*�	*�	
���,��4�4�4��6�6�t�<�<�<��6�6�t�<�<�<��6�6�{�C�C�C��8�8���I�I�I��8�8���I�I�I�I�Irc������t���t���d�_���fd�}��t|����������j�����jd�����j	�����j
�����jd��dS)Nc����5�_��������j�������5�_	ddd��n#1swxYwYddd��dS#1swxYwYdSr%)rTr�r�r�r�rs���rr�zPExceptionalTestCase.testNestedExceptionBeforeInnerStatement.<locals>.shouldThrow�s����
�4�8��2�2�6�:�:�:��4�4�T�X�>�>�>��'�'�)�)�)���t�x��������������������	
�
�
�
�
�
�
�
�
�
�
�
����
�
�
�
�
�
s6�AA:�A"�A:�"A&	�&A:�)A&	�*A:�:A>�A>)r3r�rVr;r�r�rTr�r�r
rrrs` @@r�'testNestedExceptionBeforeInnerStatementz;ExceptionalTestCase.testNestedExceptionBeforeInnerStatement�s������.�0�0��.�0�0�����	�	�	�	�	�	�	�	
���,��4�4�4��6�6�v�>�>�>��8�8���B�B�B�	
�����4�(�(�(�����,�-�-�-�����+�,�,�,�����)�4�0�0�0�0�0rc�D����t���t������fd�}��t|���������������j�����j��dS)Nc�j���5�_�5�_�������������j�����j��ddd��n#1swxYwY����ddd��dS#1swxYwYdSr%rrs���rr�zOExceptionalTestCase.testNestedExceptionAfterInnerStatement.<locals>.shouldThrow�s>����
*�4�8��C�t�x��6�6�v�>�>�>��6�6�v�>�>�>��8�8���B�B�B��8�8���B�B�B�	C�C�C�C�C�C�C�C�C�C�C����C�C�C�C�
�'�'�)�)�)�

*�
*�
*�
*�
*�
*�
*�
*�
*�
*�
*�
*����
*�
*�
*�
*�
*�
*s5�B(�A$A<�0B(�<B	�B(�B	�B(�(B,�/B,)	r3rVr;r�r�r�rTr�r�rs` @@r�&testNestedExceptionAfterInnerStatementz:ExceptionalTestCase.testNestedExceptionAfterInnerStatement�s������.�0�0��.�0�0��	*�	*�	*�	*�	*�	*�	*�	
���,��4�4�4��6�6�v�>�>�>��4�4�V�<�<�<��8�8���B�B�B��6�6�t�x�@�@�@�@�@rc���td�����fd�}|�td��5|��ddd��dS#1swxYwYdS)Nc3�K�dV�dSr%r)r)rrr�z8ExceptionalTestCase.testRaisedStopIteration1.<locals>.cm�������E�E�E�E�Erc�R�����5td���#1swxYwYdS�N�	from with��
StopIteration�r�s�rr�zAExceptionalTestCase.testRaisedStopIteration1.<locals>.shouldThrow��Y�������
1�
1�#�K�0�0�0�
1�
1�
1�
1����
1�
1�
1�
1�
1�
1��� � r)rrfrr�s  @r�testRaisedStopIteration1z,ExceptionalTestCase.testRaisedStopIteration1�s����	�	�	�
��	�	1�	1�	1�	1�	1��
#�
#�M�;�
?�
?�	�	��K�M�M�M�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s�A
�
A�Ac���Gd�dt����fd�}|�td��5|��ddd��dS#1swxYwYdS)Nc��eZdZd�Zd�ZdS)�8ExceptionalTestCase.testRaisedStopIteration2.<locals>.cmc��dSr%r)rs rrzBExceptionalTestCase.testRaisedStopIteration2.<locals>.cm.__enter__�r]rc��dSr%r)rs    rrzAExceptionalTestCase.testRaisedStopIteration2.<locals>.cm.__exit__�r]rNr�r)rrr�r!��2������
�
�
�
�
�
�
�
rr�c�R�����5td���#1swxYwYdSrrrs�rr�zAExceptionalTestCase.testRaisedStopIteration2.<locals>.shouldThrow�rrr)rerfrr�s  @r�testRaisedStopIteration2z,ExceptionalTestCase.testRaisedStopIteration2�s����	�	�	�	�	��	�	�	�	1�	1�	1�	1�	1��
#�
#�M�;�
?�
?�	�	��K�M�M�M�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s�A
�
A�Ac���td�����fd�}|�t��5|��ddd��dS#1swxYwYdS)Nc3�K�dV�dSr%r)r)rrr�z8ExceptionalTestCase.testRaisedStopIteration3.<locals>.cm�rrc�l�����5ttg�����#1swxYwYdSr%)�next�iterrs�rr�zAExceptionalTestCase.testRaisedStopIteration3.<locals>.shouldThrow�s]�������
%�
%��4��8�8�n�n�$�
%�
%�
%�
%����
%�
%�
%�
%�
%�
%s�)�-�-)rrVrr�s  @r�testRaisedStopIteration3z,ExceptionalTestCase.testRaisedStopIteration3�s����
�	�	�
��	�	%�	%�	%�	%�	%��
�
�}�
-�
-�	�	��K�M�M�M�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s�A	�	A
�A
c�h��td�����fd�}|�t|��dS)Nc3�K�dV�dSr%r)r)rrr�z8ExceptionalTestCase.testRaisedGeneratorExit1.<locals>.cm�rrc�R�����5td���#1swxYwYdSr��
GeneratorExitrs�rr�zAExceptionalTestCase.testRaisedGeneratorExit1.<locals>.shouldThrow�rr)rrVr1r�s  @r�testRaisedGeneratorExit1z,ExceptionalTestCase.testRaisedGeneratorExit1�sS���	�	�	�
��	�	1�	1�	1�	1�	1�	
���-��5�5�5�5�5rc�n��Gd�dt����fd�}|�t|��dS)Nc��eZdZd�Zd�ZdS)�8ExceptionalTestCase.testRaisedGeneratorExit2.<locals>.cmc��dSr%r)rs rrzBExceptionalTestCase.testRaisedGeneratorExit2.<locals>.cm.__enter__�r]rc��dSr%r)rs    rrzAExceptionalTestCase.testRaisedGeneratorExit2.<locals>.cm.__exit__�r]rNr�r)rrr�r5�r$rr�c�R�����5td���#1swxYwYdSrr0rs�rr�zAExceptionalTestCase.testRaisedGeneratorExit2.<locals>.shouldThrowrr)rerVr1r�s  @r�testRaisedGeneratorExit2z,ExceptionalTestCase.testRaisedGeneratorExit2�sd���	�	�	�	�	�&�	�	�	�	1�	1�	1�	1�	1�	
���-��5�5�5�5�5rc�����Gd�dt�����fd�}|����fd�}��t|����fd�}��t|��dS)Nc� �eZdZd�Zd�Zd�ZdS)�0ExceptionalTestCase.testErrorsInBool.<locals>.cmc�D��G�fd�d��}|��|_dS)Nc���eZdZ�fd�ZdS)�GExceptionalTestCase.testErrorsInBool.<locals>.cm.__init__.<locals>.Boolc������Sr%r))r�bool_conversions �r�__bool__zPExceptionalTestCase.testErrorsInBool.<locals>.cm.__init__.<locals>.Bool.__bool__s���.��0�0�0rN)rr r!rB)rAs�r�Boolr?
s.�������1�1�1�1�1�1�1rrC��exit_result)rrArCs ` rrz9ExceptionalTestCase.testErrorsInBool.<locals>.cm.__init__sK���1�1�1�1�1�1�1�1�1�1�$(�4�6�6�� � � rc��dS)N�r)rs rrz:ExceptionalTestCase.testErrorsInBool.<locals>.cm.__enter__s���qrc��|jSr%rD�r�a�b�cs    rrz9ExceptionalTestCase.testErrorsInBool.<locals>.cm.__exit__s���'�'rNrHr)rrr�r<sA������
*�
*�
*�

�
�
�
(�
(�
(�
(�
(rr�c�|���d���5��d��ddd��dS#1swxYwYdS)Nc��dSrr)r)rr�<lambda>zJExceptionalTestCase.testErrorsInBool.<locals>.trueAsBool.<locals>.<lambda>s��D�r�Should NOT see this��failr�s��r�
trueAsBoolz8ExceptionalTestCase.testErrorsInBool.<locals>.trueAsBool������L�L�!�!�
1�
1��	�	�/�0�0�0�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1����
1�
1�
1�
1�
1�
1��1�5�5c�|���d���5��d��ddd��dS#1swxYwYdS)Nc��dSr
r)r)rrrOzKExceptionalTestCase.testErrorsInBool.<locals>.falseAsBool.<locals>.<lambda>s��E�rzShould raiserQr�s��r�falseAsBoolz9ExceptionalTestCase.testErrorsInBool.<locals>.falseAsBools������M�M�"�"�
*�
*��	�	�.�)�)�)�
*�
*�
*�
*�
*�
*�
*�
*�
*�
*�
*�
*����
*�
*�
*�
*�
*�
*rUc�|���d���5��d��ddd��dS#1swxYwYdS)Nc��ddzSr�r)r)rrrOzJExceptionalTestCase.testErrorsInBool.<locals>.failAsBool.<locals>.<lambda>!s
��A�q�D�rrPrQr�s��r�
failAsBoolz8ExceptionalTestCase.testErrorsInBool.<locals>.failAsBool rTrU)rerV�AssertionErrorr�)rrSrXr[r�s`   @r�testErrorsInBoolz$ExceptionalTestCase.testErrorsInBools�����		(�		(�		(�		(�		(��		(�		(�		(�	1�	1�	1�	1�	1�	1�	�
����	*�	*�	*�	*�	*�	*�	
���.�+�6�6�6�	1�	1�	1�	1�	1�	1�	
���+�Z�8�8�8�8�8rN)rr r!r�rr�rrrrr&r,r2r9r]r)rrr�r�cs�������	H�	H�	H�N�N�N�C�C�C�"J�J�J�&1�1�1�*A�A�A�"���
�
�
����
6�
6�
6�6�6�6�9�9�9�9�9rr�c�,�eZdZd�Zd�Zd�Zd�Zd�ZdS)�NonLocalFlowControlTestCasec��d}	|dz
}t��5|dz
}	ddd��n#1swxYwY|dz
}�7|�|d��dS)NrTrD�
�d��r3r��r�counters  r�
testWithBreakz)NonLocalFlowControlTestCase.testWithBreak(s�����	��q�L�G�.�0�0�
�
��2�
���
�
�
�
�
�
�
�
�
�
�
����
�
�
�
�
�s�N�G�	�	
����"�%�%�%�%�%s�*�.�.c��d}	|dz
}|dkrn2t��5|dz
}	ddd���.#1swxYwY|dz
}�>|�|d��dS)NrTrDrErarb�rdres  r�testWithContinuez,NonLocalFlowControlTestCase.testWithContinue2s�����	��q�L�G���{�{��.�0�0�
�
��2�
���
�
�
�
�
�
�
�
�
�
�
����
�
�
�
�
�s�N�G�	�	
����"�%�%�%�%�%s�1�5�5c�H�d�}|�|��d��dS)Nc�x�d}	|dz
}t��5|dz
}|cddd��S#1swxYwY|dz
}�8)NrTrDrarbr�)rfs rrTz7NonLocalFlowControlTestCase.testWithReturn.<locals>.foo?s����G�
��1���2�4�4�#�#��r�M�G�"�#�#�#�#�#�#�#�#�#�#�#�#����#�#�#�#��3���
s�+�/�/rc)r�r�s  r�testWithReturnz*NonLocalFlowControlTestCase.testWithReturn>s5��	�	�	�	
��������#�#�#�#�#rc�j�d�}t|����}|�|ddg��dS)Nc3�hK�t��5dV�dV�ddd��dS#1swxYwYdS)Nri�
r�r)rr�genz6NonLocalFlowControlTestCase.testWithYield.<locals>.genJs�����.�0�0�
�
���������
�
�
�
�
�
�
�
�
�
�
�
����
�
�
�
�
�
s�	'�+�+rirp)�listr�)rrq�xs   r�
testWithYieldz)NonLocalFlowControlTestCase.testWithYieldIsD��	�	�	�
�����K�K������R��H�%�%�%�%�%rc���d}	|dz
}t��5|dz
}t�#1swxYwY|dz
}|�d��dS#t$r|�|d��YdSwxYw)NrrDrarbzDidn't raise RuntimeErrorrc)r3r;rRr�res  r�
testWithRaisez)NonLocalFlowControlTestCase.testWithRaiseQs�����		3��q�L�G�.�0�0�
#�
#��2�
��"�"�
#�
#�
#�
#����
#�
#�
#�
#�
�s�N�G�
�I�I�1�2�2�2�2�2���	*�	*�	*����W�b�)�)�)�)�)�)�	*���s'�A�
$�(�A�(�A� A/�.A/N)rr r!rgrjrmrtrvr)rrr_r_&s_������&�&�&�
&�
&�
&�	$�	$�	$�&�&�&�3�3�3�3�3rr_c� �eZdZd�Zd�Zd�ZdS)�AssignmentTargetTestCasec�N�dgd�i}t��5|dd<|�t|�����dg��|�|ddjt
��ddd��n#1swxYwYt��5t|�����dd<|�t|�����dg��|�|ddjt
��ddd��n#1swxYwYt��5|d<t|�����}|���|�|ddg��ddd��n#1swxYwYGd�d��}|��}t��5|_|�t|d��d��ddd��dS#1swxYwYdS)	NrD�rrDrErrEc��eZdZdS)�;AssignmentTargetTestCase.testSingleComplexTarget.<locals>.CNrlr)rr�Cr|m��������rr}rTT)
r3r�rr�keysrr,�values�sortrT�hasattr)r�targetsrr}�blahs     r�testSingleComplexTargetz0AssignmentTargetTestCase.testSingleComplexTargetas����i�i�i�.��
*�
,�
,�	D���
�1�
����T�'�,�,�.�.�1�1�A�3�7�7�7����W�Q�Z��]�4�l�C�C�C�	D�	D�	D�	D�	D�	D�	D�	D�	D�	D�	D����	D�	D�	D�	D�+�
,�
,�	D��W�^�^�5E�5E�0F�0F�q�0I�!�0L����T�'�,�,�.�.�1�1�A�3�7�7�7����W�Q�Z��]�4�l�C�C�C�	D�	D�	D�	D�	D�	D�	D�	D�	D�	D�	D����	D�	D�	D�	D�+�
,�
,�	+���
�������'�'�D��I�I�K�K�K����T�A�q�6�*�*�*�	+�	+�	+�	+�	+�	+�	+�	+�	+�	+�	+����	+�	+�	+�	+�	�
�
�
�
�
�
�
��q�s�s��
*�
,�
,�	9������W�T�5�1�1�4�8�8�8�	9�	9�	9�	9�	9�	9�	9�	9�	9�	9�	9�	9����	9�	9�	9�	9�	9�	9sJ�A,B
�
B�B�&BD=�=E�E�AF3�3F7�:F7�#*H�H�!Hc� �Gd�d��}dgd�i}|��5\|dd<|dd<|dd<|�|dgd�i��ddd��n#1swxYwY|��5\t|�����dd<t|�����dd<t|�����dd<|�|dgd�i��ddd��n#1swxYwY|��5\|d<|d<|d	<|�|ddd	d���ddd��n#1swxYwYGd
�d��}|��}|��5\|_|_|_|�|jd��|�|jd��|�|jd	��ddd��dS#1swxYwYdS)Nc��eZdZd�Zd�ZdS)�>AssignmentTargetTestCase.testMultipleComplexTargets.<locals>.Cc��dS)N�rDrErGr)rs rrzHAssignmentTargetTestCase.testMultipleComplexTargets.<locals>.C.__enter__ts���rc��dSr%r)�r�t�v�tbs    rrzGAssignmentTargetTestCase.testMultipleComplexTargets.<locals>.C.__exit__u����rNr�r)rrr}r�ss"������/�/�/�.�.�.�.�.rr}rDrzrrEr�)rGrErDrGc��eZdZdS)�>AssignmentTargetTestCase.testMultipleComplexTargets.<locals>.BNrlr)rr�Br�}r~rr�)r�rrr��one�two�three)rr}r�r�r�s     r�testMultipleComplexTargetsz3AssignmentTargetTestCase.testMultipleComplexTargetsrs ��	/�	/�	/�	/�	/�	/�	/�	/��i�i�i�.��
�Q�S�S�	6�A�W�Q�Z��]�G�A�J�q�M�7�1�:�a�=����W�q�)�)�)�n�5�5�5�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6����	6�	6�	6�	6�
�Q�S�S�	6�n�T�'�.�.�*�*�+�+�A�.�q�1�4����8H�8H�3I�3I�!�3L�Q�3O�QU�V]�Vd�Vd�Vf�Vf�Qg�Qg�hi�Qj�kl�Qm����W�q�)�)�)�n�5�5�5�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6����	6�	6�	6�	6�
�Q�S�S�	:�8�W�Q�Z����W�Q�Z����W�!��a�&8�&8�9�9�9�	:�	:�	:�	:�	:�	:�	:�	:�	:�	:�	:����	:�	:�	:�	:��
�
�
�
�
�
�
��q�s�s��
�Q�S�S�	,�4�T�X�t�x������T�X�q�)�)�)����T�X�q�)�)�)����T�Z��+�+�+�	,�	,�	,�	,�	,�	,�	,�	,�	,�	,�	,�	,����	,�	,�	,�	,�	,�	,sI�:A$�$A(�+A(�9BD�D �#D �1(E%�%E)�,E)�A%H�H�
Hc��ttdd����5�^}}}|�|d��|�|ddg��|�|d��ddd��dS#1swxYwYdS)NrD�rErG�)r�ranger�rIs    r�testWithExtendedTargetsz0AssignmentTargetTestCase.testWithExtendedTargets�s���
��q�!���
%�
%�	#��!�a�����Q��"�"�"����Q��A��'�'�'����Q��"�"�"�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#����	#�	#�	#�	#�	#�	#s�A	A4�4A8�;A8N)rr r!r�r�r�r)rrrxrx_sA������9�9�9�",�,�,�$#�#�#�#�#rrxc��eZdZd�Zd�ZdS)�ExitSwallowsExceptionTestCasec��Gd�d��}	|��5ddzddd��dS#1swxYwYdS#t$r|�d��YdSwxYw)Nc��eZdZd�Zd�ZdS)�SExitSwallowsExceptionTestCase.testExitTrueSwallowsException.<locals>.AfricanSwallowc��dSr%r)rs rrz]ExitSwallowsExceptionTestCase.testExitTrueSwallowsException.<locals>.AfricanSwallow.__enter__�r�rc��dSrr)r�s    rrz\ExitSwallowsExceptionTestCase.testExitTrueSwallowsException.<locals>.AfricanSwallow.__exit__�s���rNr�r)rr�AfricanSwallowr��s"������%�%�%�5�5�5�5�5rr�rDrz,ZeroDivisionError should have been swallowed)r�rR)rr�s  r�testExitTrueSwallowsExceptionz;ExitSwallowsExceptionTestCase.testExitTrueSwallowsException�s���	6�	6�	6�	6�	6�	6�	6�	6�	F���!�!�
�
��!���
�
�
�
�
�
�
�
�
�
�
�
����
�
�
�
�
�
�� �	F�	F�	F��I�I�D�E�E�E�E�E�E�	F���s'�
9�,�9�0�9�0�9�A�Ac��Gd�d��}	|��5ddzddd��n#1swxYwY|�d��dS#t$rYdSwxYw)Nc��eZdZd�Zd�ZdS)�ZExitSwallowsExceptionTestCase.testExitFalseDoesntSwallowException.<locals>.EuropeanSwallowc��dSr%r)rs rrzdExitSwallowsExceptionTestCase.testExitFalseDoesntSwallowException.<locals>.EuropeanSwallow.__enter__�r�rc��dSr
r)r�s    rrzcExitSwallowsExceptionTestCase.testExitFalseDoesntSwallowException.<locals>.EuropeanSwallow.__exit__�s���rNr�r)rr�EuropeanSwallowr��s"������%�%�%�6�6�6�6�6rr�rDrz)ZeroDivisionError should have been raised)rRr�)rr�s  r�#testExitFalseDoesntSwallowExceptionzAExitSwallowsExceptionTestCase.testExitFalseDoesntSwallowException�s���	7�	7�	7�	7�	7�	7�	7�	7�	C� ��"�"�
�
��!���
�
�
�
�
�
�
�
�
�
�
����
�
�
�
�

�I�I�A�B�B�B�B�B��!�	�	�	��D�D�	���s,�
A
�+�A
�/�A
�/�A
�
A�AN)rr r!r�r�r)rrr�r��s:������F�F�F�
C�
C�
C�
C�
Crr�c��eZdZGd�de��ZGd�de��ZGd�de��ZGd�de��Zd	�Zd
�Z	d�Z
d�Zd
�ZdS)�
NestedWithc�"�eZdZdd�Zd�Zd�ZdS)�NestedWith.DummyNFc�F�|�|}||_||_d|_d|_dSr
)r�gobbler
r)rrr�s   rrzNestedWith.Dummy.__init__�s0���}����D�J� �D�K� %�D��$�D���rc��d|_|jSr)r
rrs rrzNestedWith.Dummy.__enter__�s�� $�D���:�rc�4�d|_||_|jrdSdSr)rr?r�rNs  rrzNestedWith.Dummy.__exit__�s*��#�D��$�D�M��{�
��t�
�
rr
rHr)rr�Dummyr��sF������	%�	%�	%�	%�	�	�	�	�	�	�	�	rr�c��eZdZd�ZdS)�NestedWith.InitRaisesc��t���r%r�rs rrzNestedWith.InitRaises.__init__�s��,�.�.�0rNr0r)rr�
InitRaisesr��s������0�0�0�0�0rr�c��eZdZd�Zd�ZdS)�NestedWith.EnterRaisesc��t���r%r�rs rrz NestedWith.EnterRaises.__enter__�s��<�>�>�1rc��dSr%r)rNs  rrzNestedWith.EnterRaises.__exit__�r�rNr�r)rr�EnterRaisesr��s"������1�1�1�+�+�+�+�+rr�c��eZdZd�Zd�ZdS)�NestedWith.ExitRaisesc��dSr%r)rs rrzNestedWith.ExitRaises.__enter__�r�rc��t���r%r�rNs  rrzNestedWith.ExitRaises.__exit__�s��\�^�^�';rNr�r)rr�
ExitRaisesr��s"������!�!�!�;�;�;�;�;rr�c��|���5}|���5}|�|j��|�|j��ddd��n#1swxYwYddd��n#1swxYwY|�|j��|�|j��dSr%)r�r�r
r)rrJrKs   r�testNoExceptionszNestedWith.testNoExceptions�s��
�Z�Z�\�\�	,�Q��
�
���	,���O�O�A�N�+�+�+��O�O�A�N�+�+�+�	,�	,�	,�	,�	,�	,�	,�	,�	,�	,�	,����	,�	,�	,�	,�	,�	,�	,�	,�	,�	,�	,�	,�	,�	,�	,����	,�	,�	,�	,�	
����
�&�&�&�����
�&�&�&�&�&s4�B�5A+�B�+A/	�/B�2A/	�3B�B�	Bc�2�	|���5}|���5	ddd��n#1swxYwYddd��n#1swxYwYn#YnxYw|�|j��|�|j��dSr%)r�r�r�r
r�rrJs  r�testExceptionInExprListz"NestedWith.testExceptionInExprList�s��	������
��D�O�O�$5�$5�
�
��
�
�
�
�
�
�
�
�
�
�
����
�
�
�
�
�
�
�
�
�
�
�
�
�
�
����
�
�
�
���	��D���������'�'�'�����
�&�&�&�&�&sK�A�A�9�A�=	�A�=	�A�A�A�A�A�A�A c��	|���5}|���5|�d��ddd��n#1swxYwYddd��n#1swxYwY|�d��n#t$rYnwxYw|�|j��|�|j��dS)Nzbody of bad with executedzRuntimeError not reraised)r�r�rRr;r�r
rr�s  r�testExceptionInEnterzNestedWith.testExceptionInEnter�sJ��	3������
7��D�$4�$4�$6�$6�
7�
7��	�	�5�6�6�6�
7�
7�
7�
7�
7�
7�
7�
7�
7�
7�
7����
7�
7�
7�
7�
7�
7�
7�
7�
7�
7�
7�
7�
7�
7�
7����
7�
7�
7�
7�

�I�I�1�2�2�2�2���	�	�	��D�	����	
�����'�'�'�����
�&�&�&�&�&sW�B�A$�A
�A$�
A	�A$�A	�A$�B�$A(�(B�+A(�,B�
B�Bc��d}|�d���5}|���5d}ddd��n#1swxYwYddd��n#1swxYwY|�|j��|�|j��|�|��|�|jdd��dS)NFT)r�r)r�r�r�r
r�assertNotEqualr?)r�
body_executedrJs   r�testExceptionInExitzNestedWith.testExceptionInExit�s2���
�
�Z�Z�t�Z�
$�
$�	!��4�?�?�+<�+<�	!�	!� �M�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!����	!�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!����	!�	!�	!�	!������'�'�'�����
�&�&�&����
�&�&�&����A�J�q�M�4�0�0�0�0�0s1�A�=�A�A	�A�A	�A�A�Ac�|�|�d���5\}}|�d���5\}}|�d|��|�d|��|�d|��|�d|��ddd��n#1swxYwYddd��dS#1swxYwYdS)N)rDrE)r)ra�rDrErar�)r�r�)r�a1�a2�b1�b2s     r�testEnterReturnsTuplez NestedWith.testEnterReturnsTuple�s>��
�Z�Z�e�Z�
$�
$�	%���R�
�Z�Z�h�Z�
'�
'�	%�+3�B�����Q��#�#�#����Q��#�#�#����R��$�$�$����R��$�$�$�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%����	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%����	%�	%�	%�	%�	%�	%s5�B1�AB�
B1�B	�B1� B	�!B1�1B5�8B5N)
rr r!rer�r�r�r�r�r�r�r�r�r)rrr�r��s���������������&1�1�1�1�1�V�1�1�1�,�,�,�,�,�f�,�,�,�<�<�<�<�<�V�<�<�<�'�'�'�'�'�'�	'�	'�	'�1�1�1�%�%�%�%�%rr��__main__)�__doc__�
__author__�	__email__r>�unittest�collectionsr�
contextlibrrrrr*rer,r3r5rJ�TestCaserPr�r�r�r�r_rxr�r�r�mainr)rr�<module>r�s'��=�=��
�#�	�
�
�
�
�����������L�L�L�L�L�L�L�L�L�L�C�C�C�C�C�1�C�C�C�$��������6����������!5�!5�!5�!5�!5�V�!5�!5�!5�H0�0�0�0�0��0�0�0�"Q5�Q5�Q5�Q5�Q5�h�'�Q5�Q5�Q5�f,0�,0�,0�,0�,0�6�,0�,0�,0�^2<�2<�2<�2<�2<�X�.�0L�2<�2<�2<�j?B�?B�?B�?B�?B�8�#4� �?B�?B�?B�D@9�@9�@9�@9�@9�6��8I�@9�@9�@9�F63�63�63�63�63�(�"3�63�63�63�r)#�)#�)#�)#�)#�x�0�)#�)#�)#�XC�C�C�C�C�H�$5�C�C�C�2J%�J%�J%�J%�J%��"�J%�J%�J%�X�z����H�M�O�O�O�O�O��r