403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.217.51
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python313/Lib/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python313/Lib/test/__pycache__/test_with.cpython-313.opt-1.pyc
�

��i6r��R�SrSrSrSSKrSSKrSSKrSSKJr SSKJ	r	J
r
Jr "SS\	5rS	r
"S
S\5r\
S5r"S
S\5r"SS\5r"SS\R&5r"SS\5r"SS\R&\5r"SS\R&\5r"SS\\R&5r"SS\R&5r"SS\R&5r"SS \R&5r"S!S"\R&5r\S#:Xa\R<"5 gg)$z7Unit tests for the with statement specified in PEP 343.z
Mike Blandzmbland at acm dot org�N)�deque)�_GeneratorContextManager�contextmanager�nullcontextc�4^�\rSrSrU4SjrSrSrSrU=r$)�MockContextManager�c�J>�[TU]"U6 SUlSUlSUlg�NF)�super�__init__�enter_called�exit_called�	exit_args)�self�args�	__class__s  ��#C:\Python313\\Lib\test\test_with.pyr
�MockContextManager.__init__s'���
���$��!��� ������c�<�SUl[R"U5$�NT)rr�	__enter__�rs rr�MockContextManager.__enter__s�� ���'�1�1�$�7�7rc�P�SUlXU4Ul[R"XX#5$r)rrr�__exit__�r�type�value�	tracebacks    rr�MockContextManager.__exit__s0������y�1���'�0�0��16�C�	Cr�rrr)	�__name__�
__module__�__qualname__�__firstlineno__r
rr�__static_attributes__�
__classcell__)rs@rrrs����8�C�Crrc�^�U4SjnU$)Nc�>�[TX5$�N)r)r�kwds�funcs  �r�helper�#mock_contextmanager.<locals>.helper!s���!�$��3�3r�)r.r/s` r�mock_contextmanagerr2 s
���4��Mrc��\rSrSrSrSrg)�MockResource�&c� �SUlSUlgr)�yielded�stoppedrs rr
�MockResource.__init__'s�������r)r8r7N�r$r%r&r'r
r(r1rrr4r4&s��rr4c#�^# �[5nSUlUv� SUlg!SUlf=f7fr)r4r7r8)�mocks r�mock_contextmanager_generatorr=,s+����>�D������
�����t���s�-�!�-�	*�-c�&�\rSrSrSrSrSrSrg)�Nested�6c��XlSUlgr,)�managers�entered�rrBs  rr
�Nested.__init__8s�� �
���rc�T�URb[S5e[5Ul/nURH=nUR	UR55 URR
U5 M? U$! UR"[R"56(deU$=f)NzContext is not reentrant)
rC�RuntimeErrorrrB�appendr�
appendleftr�sys�exc_info)r�vars�mgrs   rr�Nested.__enter__<s����<�<�#��9�:�:��w�����	��}�}�����C�M�M�O�,����'�'��,�%����	��=�=�#�,�,�.�1��2���s�A
A:�:*B'c���UnURHnUR"U6(aSnMM SUlX!LaUeg![a"n[U5XDR4nSnAMUSnAff=f�N)NNN)rCr�
BaseExceptionr�
__traceback__)rrK�exrM�es     rr�Nested.__exit__Jso�����<�<�C�
3��<�<��$�+�B�%� ����
���H���!�
3��1�g�q�/�/�2���
3�s�=�
A)�A$�$A))rCrBN�r$r%r&r'r
rrr(r1rrr?r?6s����
rr?c�&�\rSrSrSrSrSrSrg)�
MockNested�Zc�\�[R"U/UQ76 SUlSUlSUlgr)r?r
rrrrDs  rr
�MockNested.__init__[s*������(�x�(�!��� �����rc�:�SUl[RU5$r)rr?rrs rr�MockNested.__enter__as�� �������%�%rc�J�SUlXl[R"U/UQ76$r)rrr?r�rrKs  rr�MockNested.__exit__es#�����!�����t�/�h�/�/rr#NrVr1rrrXrXZs���&�0rrXc�P�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
Srg
)�FailureTestCase�kc�6�SnUR[U5 g)Nc�D�[ SSS5 g!,(df   g=fr,��foor1rr�fooNotDeclared�5FailureTestCase.testNameError.<locals>.fooNotDeclaredms������s��
)�assertRaises�	NameError)rrhs  r�
testNameError�FailureTestCase.testNameErrorls��	����)�^�4rc�^^�"SS[5mU4SjnUR[SU5 g)Nc��\rSrSrSrSrg)�<FailureTestCase.testEnterAttributeError1.<locals>.LacksEnter�rc��gr,r1rs    rr�EFailureTestCase.testEnterAttributeError1.<locals>.LacksEnter.__exit__s���rr1N)r$r%r&r'rr(r1rr�
LacksEnterrpr���
rruc�L>�T"5nU SSS5 g!,(df   g=fr,r1)rgrus �r�
fooLacksEnter�?FailureTestCase.testEnterAttributeError1.<locals>.fooLacksEntervs����,�C��������
#�the context manager��object�assertRaisesRegex�	TypeError)rrxrus  @r�testEnterAttributeError1�(FailureTestCase.testEnterAttributeError1qs)���	��	�	�	
���y�*?��Orc�^^�"SS[5mU4SjnUR[SU5 g)Nc��\rSrSrSrg)�CFailureTestCase.testEnterAttributeError2.<locals>.LacksEnterAndExit�|r1N�r$r%r&r'r(r1rr�LacksEnterAndExitr�|s��rr�c�L>�T"5nU SSS5 g!,(df   g=fr,r1)rgr�s �r�fooLacksEnterAndExit�FFailureTestCase.testEnterAttributeError2.<locals>.fooLacksEnterAndExits���#�%�C�����rzr{r|)rr�r�s  @r�testEnterAttributeError2�(FailureTestCase.testEnterAttributeError2{s*���	��	�	�	
���y�*?�AU�Vrc�^^�"SS[5mU4SjnUR[SU5 g)Nc��\rSrSrSrSrg)�9FailureTestCase.testExitAttributeError.<locals>.LacksExit�c��gr,r1rs rr�CFailureTestCase.testExitAttributeError.<locals>.LacksExit.__enter__�rtrr1N)r$r%r&r'rr(r1rr�	LacksExitr��rvrr�c�L>�T"5nU SSS5 g!,(df   g=fr,r1)rgr�s �r�fooLacksExit�<FailureTestCase.testExitAttributeError.<locals>.fooLacksExit�s����+�C�����rzzthe context manager.*__exit__r|)rr�r�s  @r�testExitAttributeError�&FailureTestCase.testExitAttributeError�s)���	��	�	�	
���y�*I�<�Xrc�6�SnUR[X!5 g)Nc��[USS5 g)N��single)�compile)�ss r�shouldRaiseSyntaxError�GFailureTestCase.assertRaisesSyntaxError.<locals>.shouldRaiseSyntaxError�s���A�r�8�$r)rj�SyntaxError)r�codestrr�s   r�assertRaisesSyntaxError�'FailureTestCase.assertRaisesSyntaxError�s��	%����+�'=�Grc�H�URS5 URS5 g)Nzwith mock as None:
  passzwith mock as (None):
  pass�r�rs r�testAssignmentToNoneError�)FailureTestCase.testAssignmentToNoneError�s$���$�$�%A�B��$�$�
�	rc�H�URS5 URS5 g)Nzwith mock as None,:
  passzwith mock as (None,):
  passr�rs r�,testAssignmentToTupleOnlyContainingNoneError�<FailureTestCase.testAssignmentToTupleOnlyContainingNoneError�s$���$�$�%B�C��$�$�
�	rc�&�URS5 g)Nz%with mock as (foo, None, bar):
  passr�rs r�(testAssignmentToTupleContainingNoneError�8FailureTestCase.testAssignmentToTupleContainingNoneError�s���$�$�
�	rc�^^�"SS[5mUU4SjnTR[U5 TRTRS5 g)Nc� �\rSrSrSrSrSrg)�4FailureTestCase.testEnterThrows.<locals>.EnterThrows�c��[S5e)NzEnter threw�rGrs rr�>FailureTestCase.testEnterThrows.<locals>.EnterThrows.__enter__�s
��"�=�1�1rc��gr,r1�rrs  rr�=FailureTestCase.testEnterThrows.<locals>.EnterThrows.__exit__�rtrr1N�r$r%r&r'rrr(r1rr�EnterThrowsr��s��
2�
rr�c�f>�T"5nSTlUTlSSS5 g!,(df   g=fr,rf)�ctr�rs ��r�shouldThrow�4FailureTestCase.testEnterThrows.<locals>.shouldThrow�s'�����B��D�H��t�x�����s�"�
0)r}rjrG�assertEqualrg)rr�r�s` @r�testEnterThrows�FailureTestCase.testEnterThrows�s:���	�&�	�	�	
���,��4�������4�(rc�\^�"SS[5mU4SjnUR[U5 g)Nc� �\rSrSrSrSrSrg)�2FailureTestCase.testExitThrows.<locals>.ExitThrows�c��gr,r1rs rr�<FailureTestCase.testExitThrows.<locals>.ExitThrows.__enter__�s��rc��[S5e)N�*r�r�s  rr�;FailureTestCase.testExitThrows.<locals>.ExitThrows.__exit__�s
��"�2�&�&rr1Nr�r1rr�
ExitThrowsr��s��
�
'rr�c�J>�T"5 SSS5 g!,(df   g=fr,r1)r�s�rr��3FailureTestCase.testExitThrows.<locals>.shouldThrow�s���������s��
")r}rjrG)rr�r�s  @r�testExitThrows�FailureTestCase.testExitThrows�s&���	'��	'�
	�	
���,��4rrfN)r$r%r&r'rlr�r�r�r�r�r�r�r�r�r(r1rrrbrbks8��5�
P�W�Y�H�
���
)�$	5rrbc�P�\rSrSrSrSrSrSrSrSr	Sr
S
S
jrSrSr
g	)�ContextmanagerAssertionMixin�c�$�[S5Ulg)Nztest exception)rG�TEST_EXCEPTIONrs r�setUp�"ContextmanagerAssertionMixin.setUp�s��*�+;�<��rc��URUR5 URUR5 UR	UR
S5 gr,)�
assertTruer�assertFalserr�r�r�mock_managers  r�assertInWithManagerInvariants�:ContextmanagerAssertionMixin.assertInWithManagerInvariants�s>������1�1�2�����1�1�2�����/�/��6rc��URUR5 URUR5 URURU5 gr,)r�rrr�r)rr�rs   r� assertAfterWithManagerInvariants�=ContextmanagerAssertionMixin.assertAfterWithManagerInvariants�s<������1�1�2�����0�0�1�����/�/��;rc�(�URUS5 grP)r�r�s  r�'assertAfterWithManagerInvariantsNoError�DContextmanagerAssertionMixin.assertAfterWithManagerInvariantsNoError�s���-�-�l��	 rc�p�URUR5 URUR5 gr,)r�r7r�r8�r�mock_generators  r�assertInWithGeneratorInvariants�<ContextmanagerAssertionMixin.assertInWithGeneratorInvariants�s(������.�.�/�����/�/�0rc�p�URUR5 URUR5 gr,�r�r7r8r�s  r�)assertAfterWithGeneratorInvariantsNoError�FContextmanagerAssertionMixin.assertAfterWithGeneratorInvariantsNoError��&������.�.�/�����.�.�/rc��URer,�r�rs r�raiseTestException�/ContextmanagerAssertionMixin.raiseTestException�s���!�!�!rNc��URUR5 URUR5 Uc>URURSUR
5 [
UR
5nURURSU5 URURSU5 URURSS5 g)N�r�)	r�rrr�rr�r�assertIsInstance�assertIsNot)rr��exc_types   r�)assertAfterWithManagerInvariantsWithError�FContextmanagerAssertionMixin.assertAfterWithManagerInvariantsWithError�s�������1�1�2�����0�0�1������\�3�3�A�6��8K�8K�L��D�/�/�0�H�����/�/��2�H�=����l�4�4�Q�7��B�����/�/��2�D�9rc�p�URUR5 URUR5 gr,r�r�s  r�+assertAfterWithGeneratorInvariantsWithError�HContextmanagerAssertionMixin.assertAfterWithGeneratorInvariantsWithError�r�rr�r,)r$r%r&r'r�r�r�r�r�r�r�r�r�r(r1rrr�r��s5��=�7�
<�
 �1�0�"�<@�
:�0rr�c�>�\rSrSrSrSrSrSrSrSr	Sr
S	rg
)�NonexceptionalTestCase��c�N�[5 SSS5 g!,(df   g=fr,�r=rs r�testInlineGeneratorSyntax�0NonexceptionalTestCase.testInlineGeneratorSyntax�s��
*�
,��-�
,�
,�s��
$c�t�[5nU SSS5 URU5 g!,(df   N =fr,)r=r�)rr<s  r�testUnboundGenerator�+NonexceptionalTestCase.testUnboundGenerator�s+��,�.��
����4�4�T�:��T�s�)�
7c��[5nURU5 SSS5 URW5 g!,(df   N =fr,�r=r�r��rrgs  r�testInlineGeneratorBoundSyntax�5NonexceptionalTestCase.testInlineGeneratorBoundSyntax�s6��
*�
,���0�0��5�-�	
�6�6�s�;�-�
,��	�7�
Ac��[5nURU5 SSS5 URW5 g!,(df   N =fr,rr	s  r�*testInlineGeneratorBoundToExistingVariable�ANonexceptionalTestCase.testInlineGeneratorBoundToExistingVariables4��
*�
,���0�0��5�-��6�6�s�;�-�
,�rc���[5UlURUR5 SSS5 URUR5 g!,(df   N*=fr,)r=rgr�r�rs r�(testInlineGeneratorBoundToDottedVariable�?NonexceptionalTestCase.testInlineGeneratorBoundToDottedVariables>��
*�
,����0�0����:�-��6�6�t�x�x�@�-�
,�s�!A�
Ac���[5nUnURU5 URU5 SSS5 URW5 UR	U5 g!,(df   N1=fr,)r=r�r�r�r�)rr<rgs   r�testBoundGenerator�)NonexceptionalTestCase.testBoundGeneratorsV��,�.��
�S��0�0��5��.�.�t�4��	
�6�6�s�;��4�4�T�:�	�T�s�#A�
A)c���[5nUn[5nUnURU5 URU5 URU5 URU5 SSS5 URU5 UR	W5 URU5 URU5 SSS5 URU5 UR	W5 g!,(df   N}=f!,(df   NB=fr,)r=r�r�r�r�)r�mock_arg�mock_b�bars     r�testNestedSingleStatements�1NonexceptionalTestCase.testNestedSingleStatementss���.�0��
�s�2�4�F��3��2�2�6�:��2�2�6�:��4�4�S�9��4�4�S�9�	�

�8�8��@��:�:�3�?��.�.�v�6��0�0��5��	
�4�4�V�<��6�6�s�;�����V�s$�
C'�AC�AC'�
C$	� C'�'
C5rfN)r$r%r&r'rrr
rrrrr(r1rrr�r��s&���;�<�<�
A�
;�<rr�c�>�\rSrSrSrSrSrSrSrSr	Sr
S	rg
)�NestedNonexceptionalTestCasei$c�`�[[55 SSS5 g!,(df   g=fr,�r?r=rs r�"testSingleArgInlineGeneratorSyntax�?NestedNonexceptionalTestCase.testSingleArgInlineGeneratorSyntax&s��
�1�3�
4��5�
4�
4�s��
-c��[5n[U5nURU5 SSS5 URU5 g!,(df   N =fr,�r=r?r�r��r�mrgs   r�testSingleArgBoundToNonTuple�9NestedNonexceptionalTestCase.testSingleArgBoundToNonTuple*s>��)�+���A�Y�#��.�.�q�1���4�4�Q�7��Y���A�
Ac��[5n[U5nURU5 SSS5 URU5 g!,(df   N =fr,r#r$s   r�2testSingleArgBoundToSingleElementParenthesizedList�ONestedNonexceptionalTestCase.testSingleArgBoundToSingleElementParenthesizedList2s>��)�+���A�Y�3��.�.�q�1���4�4�Q�7��Y�r(c�6�SnUR[U5 g)Nc�d�[[55upSSS5 g!,(df   g=fr,r)rgrs  r�shouldThrowValueError�iNestedNonexceptionalTestCase.testSingleArgBoundToMultipleElementTupleError.<locals>.shouldThrowValueError;s!���5�7�8�J�S��9�8�8�s�!�
/)rj�
ValueError)rr.s  r�-testSingleArgBoundToMultipleElementTupleError�JNestedNonexceptionalTestCase.testSingleArgBoundToMultipleElementTupleError:s��	�	
���*�&;�<rc���[5n[U5nU URU5 URU5 SSS5 URU5 URU5 g!,(df   N1=fr,�r=rXr�r�)rr2�mock_nesteds   r�testSingleArgUnbound�1NestedNonexceptionalTestCase.testSingleArgUnbound@sb��;�=�� �!4�5��
��.�.�/B�C��.�.�{�;��	
�4�4�5H�I��4�4�[�A�	�[�s�#A&�&
A4c��[5n[5n[5n[XU5nU URU5 URU5 URU5 URU5 SSS5 URU5 URU5 URU5 URU5 g!,(df   NS=fr,r4)rr%�n�or5s     r�testMultipleArgUnbound�3NestedNonexceptionalTestCase.testMultipleArgUnboundIs���)�+��)�+��)�+�� ��q�)��
��.�.�q�1��.�.�q�1��.�.�q�1��.�.�{�;�	�
	
�4�4�Q�7��4�4�Q�7��4�4�Q�7��4�4�[�A��[�s�AB?�?
C
c��[[5[5[55nUup#nURU5 URU5 URU5 URU5 SSS5 UR	W5 UR	W5 UR	W5 URU5 g!,(df   NS=fr,)rXr=r�r�r�r�)rr5r%r9r:s     r�testMultipleArgBound�1NestedNonexceptionalTestCase.testMultipleArgBoundXs��� �!>�!@�)�+�-J�-L�N��
�I�Q�1��0�0��3��0�0��3��0�0��3��.�.�{�;�	�
	
�6�6�q�9��6�6�q�9��6�6�q�9��4�4�[�A��[�s�AB=�=
Cr1N)r$r%r&r'r r&r*r1r6r;r>r(r1rrrr$s(���8�8�=�B�
B�Brrc�\�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSrg)�ExceptionalTestCaseifc�^^�[5mUU4SjnTR[U5 TRT5 TR	TR
5 g)Nc�>�TTlTRT5 TRTR5 TR5 SSS5 g!,(df   g=fr,)�resourcer�r�r���cmrs��rr��;ExceptionalTestCase.testSingleResource.<locals>.shouldThrowis@����t�}��2�2�2�6��4�4�T�]�]�C��'�'�)����s�AA�
A)r=rjrGr�r�rD�rr�rFs` @r�testSingleResource�&ExceptionalTestCase.testSingleResourcegsB���
*�
,��	*�
	
���,��4��6�6�r�:��8�8����Grc�^^�[5mUU4SjnTR[U5 TRT[5 g)Nc�R>�TTlSS- SSS5 g!,(df   g=f�Nr�r)rDrEs��rr��@ExceptionalTestCase.testExceptionNormalized.<locals>.shouldThrowts����t�}��Q�����s��
&)r=rj�ZeroDivisionErrorr�rHs` @r�testExceptionNormalized�+ExceptionalTestCase.testExceptionNormalizedrs4���
*�
,��	�
	
���+�[�9��6�6�r�;L�Mrc�^^^�[5m[5mUUU4SjnTR[U5 TRT5 TRT5 TR	TR
5 TR	TR5 g)Nc�Z>�TTlTTlTRT5 TRT5 TRTR5 TRTR5 TR	5 SSS5 SSS5 g!,(df   N=f!,(df   g=fr,�rgrr�r�r��rrrs���rr��CExceptionalTestCase.testNestedSingleStatements.<locals>.shouldThrowsw����4�8��t�x��6�6�v�>��6�6�v�>��8�8����B��8�8����B��+�+�-�����V����s#�B�A.B�:B�
B	�B�
B*)r=rjrGr�r�rgr�rr�rrs` @@rr�.ExceptionalTestCase.testNestedSingleStatements|sj���.�0��.�0��	.�	
���,��4��6�6�v�>��6�6�v�>��8�8����B��8�8����Brc�\^^^^�[5m[5m[TT5mUUUU4SjnTR[U5 TR	T5 TR	T5 TR	T5 TRTR5 TRTR5 g)Nc�J>�TuTlTlTRT5 TRT5 TRT5 TRTR5 TRTR5 TR	5 SSS5 g!,(df   g=fr,)�
resource_a�
resource_br�r�r�)�cm_a�cm_br5rs����rr��OExceptionalTestCase.testMultipleResourcesInSingleStatement.<locals>.shouldThrow�su���� B���$�/��2�2�4�8��2�2�4�8��2�2�;�?��4�4�T�_�_�E��4�4�T�_�_�E��'�'�)�
���s�BB�
B")r=rXrjrGr�r�r[r\)rr�r]r^r5s` @@@r�&testMultipleResourcesInSingleStatement�:ExceptionalTestCase.testMultipleResourcesInSingleStatement�s����,�.��,�.�� ��t�,��	*�	*�	
���,��4��6�6�t�<��6�6�t�<��6�6�{�C��8�8����I��8�8����Irc�^^^�[5m[5mSTlUUU4SjnTR[U5 TR	T5 TRTR5 TRTRS5 TRTR5 TRTR5 TRTRS5 g)Nc�>�TTlTRT5 TRTR5 TR5 TTlSSS5 SSS5 g!,(df   N=f!,(df   g=fr,)rgr�r�r�rrUs���rr��PExceptionalTestCase.testNestedExceptionBeforeInnerStatement.<locals>.shouldThrow�s\����4�8��2�2�6�:��4�4�T�X�X�>��'�'�)��t�x���	���V��	��s$�AA1�A �A1� 
A.	�*A1�1
A?)r=rrjrGr�r�rgr�r�rrrrWs` @@r�'testNestedExceptionBeforeInnerStatement�;ExceptionalTestCase.testNestedExceptionBeforeInnerStatement�s����.�0��.�0�����	�	
���,��4��6�6�v�>��8�8����B�	
������4�(�����,�,�-�����+�+�,�����)�)�4�0rc�^^^�[5m[5mUUU4SjnTR[U5 TRT5 TR	T5 TRTR5 TRTR5 g)Nc�Z>�TTlTTlTRT5 TRT5 TRTR5 TRTR5 SSS5 TR	5 SSS5 g!,(df   N'=f!,(df   g=fr,rTrUs���rr��OExceptionalTestCase.testNestedExceptionAfterInnerStatement.<locals>.shouldThrow�sy����4�8��t�x��6�6�v�>��6�6�v�>��8�8����B��8�8����B�	�
�'�'�)�
���V����s#�B�AB�*B�
B	�B�
B*)	r=rjrGr�r�r�rgr�rrWs` @@r�&testNestedExceptionAfterInnerStatement�:ExceptionalTestCase.testNestedExceptionAfterInnerStatement�sj���.�0��.�0��	*�	
���,��4��6�6�v�>��4�4�V�<��8�8����B��6�6�t�x�x�@rc�^�[S5mU4SjnUR[S5 U"5 SSS5 g!,(df   g=f)Nc3�# �Sv� g7fr,r1r1rrrF�8ExceptionalTestCase.testRaisedStopIteration1.<locals>.cm��������c�L>�T"5 [S5e!,(df   g=f�N�	from with��
StopIteration�rFs�rr��AExceptionalTestCase.testRaisedStopIteration1.<locals>.shouldThrow�������#�K�0�0������
#rs)rr~rurHs  @r�testRaisedStopIteration1�,ExceptionalTestCase.testRaisedStopIteration1�s>���	�	�
�	�	1��
#�
#�M�;�
?��M�@�
?�
?�s	�;�
A	c�^�"SS[5mU4SjnUR[S5 U"5 SSS5 g!,(df   g=f)Nc� �\rSrSrSrSrSrg)�8ExceptionalTestCase.testRaisedStopIteration2.<locals>.cmi�c��gr,r1rs rr�BExceptionalTestCase.testRaisedStopIteration2.<locals>.cm.__enter__�rtrc��gr,r1rs    rr�AExceptionalTestCase.testRaisedStopIteration2.<locals>.cm.__exit__�rtrr1Nr�r1rrrFr~����
�
rrFc�L>�T"5 [S5e!,(df   g=frrrtrvs�rr��AExceptionalTestCase.testRaisedStopIteration2.<locals>.shouldThrow�rxryrs)r}r~rurHs  @r�testRaisedStopIteration2�,ExceptionalTestCase.testRaisedStopIteration2�s8���	��	�	1��
#�
#�M�;�
?��M�@�
?�
?�s	�>�
Ac�^�[S5mU4SjnUR[5 U"5 SSS5 g!,(df   g=f)Nc3�# �Sv� g7fr,r1r1rrrF�8ExceptionalTestCase.testRaisedStopIteration3.<locals>.cm�rorpc�^>�T"5 [[/55e!,(df   g=fr,)�next�iterrvs�rr��AExceptionalTestCase.testRaisedStopIteration3.<locals>.shouldThrow�s������4��8�n�$���s��
,)rrjrurHs  @r�testRaisedStopIteration3�,ExceptionalTestCase.testRaisedStopIteration3�s=���
�	�
�	�	%��
�
�}�
-��M�.�
-�
-�s	�:�
Ac�V^�[S5mU4SjnUR[U5 g)Nc3�# �Sv� g7fr,r1r1rrrF�8ExceptionalTestCase.testRaisedGeneratorExit1.<locals>.cm�rorpc�L>�T"5 [S5e!,(df   g=frr��
GeneratorExitrvs�rr��AExceptionalTestCase.testRaisedGeneratorExit1.<locals>.shouldThrow�rxry)rrjr�rHs  @r�testRaisedGeneratorExit1�,ExceptionalTestCase.testRaisedGeneratorExit1�s,���	�	�
�	�	1�	
���-��5rc�\^�"SS[5mU4SjnUR[U5 g)Nc� �\rSrSrSrSrSrg)�8ExceptionalTestCase.testRaisedGeneratorExit2.<locals>.cmi�c��gr,r1rs rr�BExceptionalTestCase.testRaisedGeneratorExit2.<locals>.cm.__enter__�rtrc��gr,r1rs    rr�AExceptionalTestCase.testRaisedGeneratorExit2.<locals>.cm.__exit__rtrr1Nr�r1rrrFr��r�rrFc�L>�T"5 [S5e!,(df   g=frrr�rvs�rr��AExceptionalTestCase.testRaisedGeneratorExit2.<locals>.shouldThrowrxry)r}rjr�rHs  @r�testRaisedGeneratorExit2�,ExceptionalTestCase.testRaisedGeneratorExit2�s&���	�&�	�	1�	
���-��5rc�^^�"SS[5mUU4SjnU"5 UU4SjnTR[U5 UU4SjnTR[U5 g)Nc�&�\rSrSrSrSrSrSrg)�0ExceptionalTestCase.testErrorsInBool.<locals>.cmic�8^�"U4SjS5nU"5Ulg)Nc�">�\rSrSrU4SjrSrg)�GExceptionalTestCase.testErrorsInBool.<locals>.cm.__init__.<locals>.Boolic�>�T"5$r,r1)r�bool_conversions �r�__bool__�PExceptionalTestCase.testErrorsInBool.<locals>.cm.__init__.<locals>.Bool.__bool__s���.�0�0rr1N)r$r%r&r'r�r()r�s�r�Boolr�s
���1�1rr���exit_result)rr�r�s ` rr
�9ExceptionalTestCase.testErrorsInBool.<locals>.cm.__init__s���1�1�$(�6�� rc��g)N�r1rs rr�:ExceptionalTestCase.testErrorsInBool.<locals>.cm.__enter__s��rc��UR$r,r��r�a�b�cs    rr�9ExceptionalTestCase.testErrorsInBool.<locals>.cm.__exit__s���'�'�'rr�NrVr1rrrFr�s��
*�

�
(rrFc�n>�T"S5 TRS5 SSS5 g!,(df   g=f)Nc��grr1r1rr�<lambda>�JExceptionalTestCase.testErrorsInBool.<locals>.trueAsBool.<locals>.<lambda>s��Dr�Should NOT see this��failrEs��r�
trueAsBool�8ExceptionalTestCase.testErrorsInBool.<locals>.trueAsBool�$����L�!��	�	�/�0�"�!�!���&�
4c�n>�T"S5 TRS5 SSS5 g!,(df   g=f)Nc��grr1r1rrr��KExceptionalTestCase.testErrorsInBool.<locals>.falseAsBool.<locals>.<lambda>s��ErzShould raiser�rEs��r�falseAsBool�9ExceptionalTestCase.testErrorsInBool.<locals>.falseAsBools#����M�"��	�	�.�)�#�"�"�r�c�n>�T"S5 TRS5 SSS5 g!,(df   g=f)Nc��SS-$rMr1r1rrr��JExceptionalTestCase.testErrorsInBool.<locals>.failAsBool.<locals>.<lambda>$s��A�q�Drr�r�rEs��r�
failAsBool�8ExceptionalTestCase.testErrorsInBool.<locals>.failAsBool#r�r�)r}rj�AssertionErrorrO)rr�r�r�rFs`   @r�testErrorsInBool�$ExceptionalTestCase.testErrorsInBool
sJ���		(��		(�	1�	��	*�	
���.�+�6�	1�	
���+�Z�8r)rrgrDr[r\N)r$r%r&r'rIrPrr`rerjrzr�r�r�r�r�r(r1rrrArAfsC��	H�N�C�"J�&1�*A�"�
��
6�6�9rrAc�2�\rSrSrSrSrSrSrSrSr	g)	�NonLocalFlowControlTestCasei)c��SnUS-
n[5 US-
nSSS5 URUS5 g!,(df   O=fUS-
nMI)Nrr��
�d��r=r��r�counters  r�
testWithBreak�)NonLocalFlowControlTestCase.testWithBreak+sU������q�L�G�.�0��2�
���1�	
����"�%�	1�0��
�s�N�G�s	�5�
Ac��SnUS-
nUS:�aO[5 US-
nSSS5 M(URUS5 g!,(df   O=fUS-
nMR)Nrr�r�r�r��r�r�s  r�testWithContinue�,NonLocalFlowControlTestCase.testWithContinue5sb������q�L�G���{��.�0��2�
���1�0�	
����"�%�	1�0��
�s�N�G�s	�>�
Ac�8�SnURU"5S5 g)Nc�x�SnUS-
n[5 US-
nUsSSS5 $!,(df   O=fUS-
nM8)Nrr�r�r�r)r�s rrg�7NonLocalFlowControlTestCase.testWithReturn.<locals>.fooBsA���G���1���2�4��r�M�G�"�5�4�4���3���s�$�
2r�)r�r	s  r�testWithReturn�*NonLocalFlowControlTestCase.testWithReturnAs��	�	
������#rc�R�Sn[U"55nURUSS/5 g)Nc3�d# �[5 Sv� Sv� SSS5 g!,(df   g=f7f)Nr��
rr1rr�gen�6NonLocalFlowControlTestCase.testWithYield.<locals>.genMs ���.�0�����1�0�0�s�0�	�	0�
-�0r�r�)�listr�)rr��xs   r�
testWithYield�)NonLocalFlowControlTestCase.testWithYieldLs(��	�
���K������R��H�%rc���SnUS-
n[5 US-
n[e!,(df   O=fUS-
nURS5 g![a URUS5 gf=f)Nrr�r�r�zDidn't raise RuntimeErrorr�)r=rGr�r�r�s  r�
testWithRaise�)NonLocalFlowControlTestCase.testWithRaiseTsn����		3��q�L�G�.�0��2�
��"�"�1�0��
�s�N�G�
�I�I�1�2���	*����W�b�)�	*�s�A��
-�A�A&�%A&r1N)
r$r%r&r'r�r�r�r�r�r(r1rrr�r�)s��&�
&�	$�&�3rr�c�&�\rSrSrSrSrSrSrg)�AssignmentTargetTestCaseibc��S/SQ0n[5USS'UR[UR55S/5 URUSSR[
5 SSS5 [5[UR
55SS'UR[UR55S/5 URUSSR[
5 SSS5 [5US'[UR55nUR5 URUSS/5 SSS5 "SS5nU"5n[5UlUR[US5S5 SSS5 g!,(df   GN(=f!,(df   N�=f!,(df   Nw=f!,(df   g=f)	Nr��rr�r�rr�c��\rSrSrSrg)�;AssignmentTargetTestCase.testSingleComplexTarget.<locals>.Cipr1Nr�r1rr�Cr�p���rr�rgT)
r=r�r��keysrr4�values�sortrg�hasattr)r�targetsr�r��blahs     r�testSingleComplexTarget�0AssignmentTargetTestCase.testSingleComplexTargetdsV���i�.��
*�
,���
�1�
����T�'�,�,�.�1�A�3�7����W�Q�Z��]�4�4�l�C�-�+�
,��W�^�^�5E�0F�q�0I�!�0L����T�'�,�,�.�1�A�3�7����W�Q�Z��]�4�4�l�C�-�+�
,���
������'�D��I�I�K����T�A�q�6�*�-�	�
��s��
*�
,������W�T�5�1�4�8�-�
,�-�
,��-�
,��-�
,��-�
,�s2�AF	�:A.F�:AF,�"F=�	
F�
F)�,
F:�=
Gc��"SS5nS/SQ0nU"5uUSS'USS'USS'URUS/SQ05 SSS5 U"5u[UR55SS'[UR55SS'[UR55SS'URUS/SQ05 SSS5 U"5uUS'US'US	'URUSSS	S.5 SSS5 "S
S5nU"5nU"5uUlUlUlURURS5 URURS5 URUR
S	5 SSS5 g!,(df   GNL=f!,(df   N�=f!,(df   N�=f!,(df   g=f)Nc� �\rSrSrSrSrSrg)�>AssignmentTargetTestCase.testMultipleComplexTargets.<locals>.Civc��g)N�r�r�r�r1rs rr�HAssignmentTargetTestCase.testMultipleComplexTargets.<locals>.C.__enter__ws��rc��gr,r1�r�t�v�tbs    rr�GAssignmentTargetTestCase.testMultipleComplexTargets.<locals>.C.__exit__xs��$rr1Nr�r1rrr�rvs��/�.rr�r�r�rr�r)r�r�r�r�c��\rSrSrSrg)�>AssignmentTargetTestCase.testMultipleComplexTargets.<locals>.Bi�r1Nr�r1rr�Br�r�rr)r�r�r��one�two�three)rr�rrrs     r�testMultipleComplexTargets�3AssignmentTargetTestCase.testMultipleComplexTargetsusz��	/�	/��i�.��
�S�A�W�Q�Z��]�G�A�J�q�M�7�1�:�a�=����W�q�)�n�5��
�S�n�T�'�.�.�*�+�A�.�q�1�4����8H�3I�!�3L�Q�3O�QU�V]�Vd�Vd�Vf�Qg�hi�Qj�kl�Qm����W�q�)�n�5��
�S�8�W�Q�Z����W�Q�Z����W�!��a�&8�9���
��s��
�S�4�T�X�t�x������T�X�X�q�)����T�X�X�q�)����T�Z�Z��+��S��S��
�S��
�S���S�s1�-F
�A2F�$F-�A(F>�

F�
F*�-
F;�>
Gc���[[SS55GtpnURUS5 URUSS/5 URUS5 SSS5 g!,(df   g=f)Nr��r�r��)r�ranger�r�s    r�testWithExtendedTargets�0AssignmentTargetTestCase.testWithExtendedTargets�sV��
��q�!��
%��!�����Q��"����Q��A��'����Q��"�&�
%�
%�s�<A�
A)r1N)r$r%r&r'rrrr(r1rrr�r�bs��9�",�$#rr�c� �\rSrSrSrSrSrg)�ExitSwallowsExceptionTestCasei�c��"SS5nU"5 SS- SSS5 g!,(df   g=f![a URS5 gf=f)Nc� �\rSrSrSrSrSrg)�SExitSwallowsExceptionTestCase.testExitTrueSwallowsException.<locals>.AfricanSwallowi�c��gr,r1rs rr�]ExitSwallowsExceptionTestCase.testExitTrueSwallowsException.<locals>.AfricanSwallow.__enter__����rc��grr1rs    rr�\ExitSwallowsExceptionTestCase.testExitTrueSwallowsException.<locals>.AfricanSwallow.__exit__�s��rr1Nr�r1rr�AfricanSwallowr"�s��%�5rr(r�rz,ZeroDivisionError should have been swallowed)rOr�)rr(s  r�testExitTrueSwallowsException�;ExitSwallowsExceptionTestCase.testExitTrueSwallowsException�sH��	6�	6�	F��!��!��"�!�!�� �	F��I�I�D�E�	F�s#�3�"�3�
0�3�3�A�Ac��"SS5nU"5 SS- SSS5 URS5 g!,(df   N =f![a gf=f)Nc� �\rSrSrSrSrSrg)�ZExitSwallowsExceptionTestCase.testExitFalseDoesntSwallowException.<locals>.EuropeanSwallowi�c��gr,r1rs rr�dExitSwallowsExceptionTestCase.testExitFalseDoesntSwallowException.<locals>.EuropeanSwallow.__enter__�r%rc��grr1rs    rr�cExitSwallowsExceptionTestCase.testExitFalseDoesntSwallowException.<locals>.EuropeanSwallow.__exit__�s��rr1Nr�r1rr�EuropeanSwallowr-�s��%�6rr2r�rz)ZeroDivisionError should have been raised)r�rO)rr2s  r�#testExitFalseDoesntSwallowException�AExitSwallowsExceptionTestCase.testExitFalseDoesntSwallowException�sM��	7�	7�	C� �"��!��#�

�I�I�A�B�#�"�� �	��	�s$�A�3�A�
A�A�
A�Ar1N)r$r%r&r'r)r3r(r1rrrr�s��F�
Crrc��\rSrSr"SS\5r"SS\5r"SS\5r"SS	\5rS
r	Sr
SrS
rSr
SrSrg)�
NestedWithi�c�*�\rSrSrSSjrSrSrSrg)�NestedWith.Dummyi�Nc�B�UcUnXlX lSUlSUlgr)r �gobblerr)rr r:s   rr
�NestedWith.Dummy.__init__�s&���}����J� �K� %�D��$�D�rc�(�SUlUR$r)rr rs rr�NestedWith.Dummy.__enter__�s�� $�D���:�:�rc�B�SUlXlUR(aggr)rrKr:r_s  rr�NestedWith.Dummy.__exit__�s��#�D��$�M��{�{��r)rrKrr:r rrVr1rr�Dummyr8�s��	%�	�	rr@c��\rSrSrSrSrg)�NestedWith.InitRaisesi�c��[5er,r�rs rr
�NestedWith.InitRaises.__init__�s	��,�.�0rr1Nr:r1rr�
InitRaisesrB�s��0rrEc� �\rSrSrSrSrSrg)�NestedWith.EnterRaisesi�c��[5er,r�rs rr� NestedWith.EnterRaises.__enter__�s	��<�>�1rc��gr,r1r_s  rr�NestedWith.EnterRaises.__exit__�s��trr1Nr�r1rr�EnterRaisesrG�s��1�+rrLc� �\rSrSrSrSrSrg)�NestedWith.ExitRaisesi�c��gr,r1rs rr�NestedWith.ExitRaises.__enter__�s��Trc��[5er,r�r_s  rr�NestedWith.ExitRaises.__exit__�s	��\�^�';rr1Nr�r1rr�
ExitRaisesrN�s��!�;rrSc��UR5oR5nURUR5 URUR5 SSS5 SSS5 URWR5 URWR5 g!,(df   NM=f!,(df   NV=fr,)r@r�rr)rr�r�s   r�testNoExceptions�NestedWith.testNoExceptions�sk��
�Z�Z�\�Q�
�
����O�O�A�N�N�+��O�O�A�N�N�+�!-�\�	
����
�
�&�����
�
�&�	!-���\�\�s"�B0�7B�B0�
B-	�)B0�0
B>c�(�UR5oR5 SSS5 SSS5 URWR5 URUR5 g!,(df   NM=f!,(df   NV=f! N]=fr,)r@rEr�rr�rr�s  r�testExceptionInExprList�"NestedWith.testExceptionInExprList�s\��	������O�O�$5��%6��	
������'�����
�
�&�%6�$5�����	��s=�B
�A<�A+�A<�B
�+
A9	�5A<�<
B
�B
�
B
�
Bc�|�UR5oR5 URS5 SSS5 SSS5 URS5 UR	WR
5 UR	UR5 g!,(df   N^=f!,(df   Ng=f![a Nef=f)Nzbody of bad with executedzRuntimeError not reraised)r@rLr�rGr�rrrXs  r�testExceptionInEnter�NestedWith.testExceptionInEnter�s}��	3������$4�$4�$6��	�	�5�6�%7��

�I�I�1�2�������'�����
�
�&�%7�$6������	��	�s=�B.�B�B�B�B.�
B	�B�
B+�'B.�.
B;�:B;c�|�SnURSS9o R5 SnSSS5 SSS5 URWR5 URUR5 URU5 URURSS5 g!,(df   N}=f!,(df   N�=f)NFT)r:r)r@rSr�rr�assertNotEqualrK)r�
body_executedr�s   r�testExceptionInExit�NestedWith.testExceptionInExit�s���
�
�Z�Z�t�Z�
$��?�?�+<� �M�,=�
$�������'�����
�
�&����
�&����A�J�J�q�M�4�0�,=�+<��
$�
$�s!�B-�B�B-�
B*	�&B-�-
B;c�@�URSS9upURSS9up4URSU5 URSU5 URSU5 URSU5 SSS5 SSS5 g!,(df   N=f!,(df   g=f)N)r�r�)r )r��r�r�r�rd)r@r�)r�a1�a2�b1�b2s     r�testEnterReturnsTuple� NestedWith.testEnterReturnsTuple�s���
�Z�Z�e�Z�
$���
�Z�Z�h�Z�
'�8�B����Q��#����Q��#����R��$����R��$�	(�%�
$�
'�
'��%�
$�s#�B�AA>�-B�>
B	�B�
Bc�0^�U4SjnU4SjnU4SjnUS4US4US44H�upETRU5 U"5n[R"UR5SnSnURn	TRURU	RS	-5 TRURU	RS	-5 TRURURU-
URU-
U5 SSS5 M� g!,(df   M�=f)
Nc�8>�TR5 TR5nTR5nSSS5 SSS5 SSS5 g!,(df   N=f!,(df   N(=f!,(df   g=f![anUsSnA$SnAff=fr,)r@rE�	Exception)rF�drTrs   �r�init_raises�5NestedWith.testExceptionLocation.<locals>.init_raises�s[���
��Z�Z�\�4�?�?�#4��D�J�J�L�A��=I�#4�\�\�L�L��#4�#4��\�\���
����
�sf�B�A2�A!�A�A!�A2�B�
A�A!�!
A/	�+A2�2
B�<B�B�
B�
B�B�Bc��>�TR5 TR5nSSS5 SSS5 g!,(df   N=f!,(df   g=f![anUsSnA$SnAff=fr,)rLr@rm�rnrTrs  �r�enter_raises�6NestedWith.testExceptionLocation.<locals>.enter_raisessL���
��%�%�'�������*6�'�'����'�'���
����
��M�A�A�7�A�A�
A	�A�
A�A�A�
A/�#A*�$A/�*A/c��>�TR5 TR5nSSS5 SSS5 g!,(df   N=f!,(df   g=f![anUsSnA$SnAff=fr,)rSr@rmrrs  �r�exit_raises�5NestedWith.testExceptionLocation.<locals>.exit_raisessJ���
��_�_�&��
�
����)5�&�&����&�&���
����
�ruzself.InitRaises()zself.EnterRaises()zself.ExitRaises()r�r�)�subTestr!�
extract_tbrR�__code__r��lineno�co_firstlineno�
end_lineno�line�colno�	end_colno)
rrorsrwr.�expected�exc�f�indent�cos
`         r�testExceptionLocation� NestedWith.testExceptionLocation�s����	�	�	�!,�-@�A� ,�.B�C� +�-@�A� �N�D����d�#��f���(�(��):�):�;�A�>�����]�]��� � ����2�+<�+<�q�+@�A�� � ����r�/@�/@�1�/D�E�� � �������&�(8�1�;�;��;O�!P�!)�+�$�#�	 �$�#�s�CD�
D	r1N)r$r%r&r'r}r@rErLrSrUrYr\rarir�r(r1rrr6r6�sP�����&1�V�1�,�f�,�<�V�<�'�'�	'�1�%�(+rr6�__main__)�__doc__�
__author__�	__email__rJr!�unittest�collectionsr�
contextlibrrrrr2r}r4r=r?rX�TestCaserbr�r�rrAr�r�rr6r$�mainr1rr�<module>r�sB��=��
�#�	�
����L�L�C�1�C�$��6������!�V�!�H0��0�"T5�h�'�'�T5�l,0�6�,0�^1<�X�.�.�0L�1<�h?B�8�#4�#4� �?B�D@9�6��8I�8I�@9�F63�(�"3�"3�63�r)#�x�0�0�)#�XC�H�$5�$5�C�2t+��"�"�t+�n�z���M�M�O�r

Youez - 2016 - github.com/yon3zu
LinuXploit