403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.217.109
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:/Python315/Lib/test/test_capi/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python315/Lib/test/test_capi/__pycache__/test_watchers.cpython-315.pyc
R
>lqj�fc�f�]PHs]PHs]QHGsGs]QHGsGsGs\OQ2s
QQ\O2sQQ\O2s
QQ	\O2sQ
Q\O2sQQ
\O2s\Q6Xc\O$2P!P!)�)�contextmanager�	ExitStack)�catch_unraisable_exception�
import_helper�
gc_collect�	_testcapic��`�\sQs]sn]s]s]s\1QksQs\	\1Qk2s
QsQsQs
QsQsQ	sQ
sQsQsQ
sQsQsQsQsQsQsQsQsQsQsQsQs Qs!Qs"Qs#Us$P!)�TestDictWatchersc�.�[OU2!�N)r�add_dict_watcher��self�kinds&&�1C:\Python315\\Lib\test\test_capi\test_watchers.py�add_watcher�TestDictWatchers.add_watcher����)�)�$�/�/�c�2�[OU2P!r)r�clear_dict_watcher�r�
watcher_ids&&r�
clear_watcher�TestDictWatchers.clear_watcher����$�$�Z�0rc#� �UOU2oUw�UOU2P!SOS2h9h3hr�rr�rr�wids&& r�watcher�TestDictWatchers.watcher�;������t�$��	$��I����s�#��D���s�#���A�.�A�A�Ac�R�[O2oUOV!2P!r)r�get_dict_watcher_events�assertEqual�r�expected�actuals&& r�
assert_events�TestDictWatchers.assert_events"s���2�2�4������*rc�2�[OV2P!r)r�
watch_dict�rr�ds&&&r�watch�TestDictWatchers.watch&������S�$rc�2�[OV2P!r)r�unwatch_dictr.s&&&r�unwatch�TestDictWatchers.unwatch)������s�&rc���-oUO29^tt^2oUOV!2QUQ$UOQ,2PPP2P!)%fhP!9h)�bar�foo�new:foo:bar�r r0r*�rr/rs&  r�test_set_new_item�"TestDictWatchers.test_set_new_item,sE����
�\�\�^�^�s��J�J�s���A�e�H����
��/��^�^�^�s�)A�A 	�A 	c���QQ-oUO29^tt^2oUOV!2QUQ$UOQ,2PPP2P!)%fhP!9h)r:r9�baz�mod:foo:bazr<r=s&  r�test_set_existing_item�'TestDictWatchers.test_set_existing_item3sI��
�E�N��
�\�\�^�^�s��J�J�s���A�e�H����
��/��^�^�^�s�)A�A"	�A"	c���-oQQ-oUO29^tt^2oUOV12UOU2UOQ,2PPP2P!)%fhP!9h)r:r9�clone)r r0�updater*)rr/�d2rs&   r�
test_clone�TestDictWatchers.test_clone:sP�����U�^��
�\�\�^�^�s��J�J�s��
�H�H�R�L�����y�)��^�^�^�s�5A�A0	�(A0	c��-oUO29^tt^2oQUQ$UO,2PPP2P!)%fhP!9h)r9r:)r r*r=s&  r�test_no_event_if_not_watched�-TestDictWatchers.test_no_event_if_not_watchedBs7����
�\�\�^�^�s��A�e�H����r�"��^�^�^�s�=�A	�A	c���QQ-oUO29^tt^2oUOV!2UQUOQ,2PPP2P!)%fhP!9h�r:r9�del:foor<r=s&  r�test_del�TestDictWatchers.test_delHsG��
�E�N��
�\�\�^�^�s��J�J�s���%�����	�{�+��^�^�^�s�'A�A 	�A 	c���QQ-oUO29^tt^2oUOV!2UOQ2UOQ,2PPP2P!)%fhP!9hrO)r r0�popr*r=s&  r�test_pop�TestDictWatchers.test_popOsK��
�E�N��
�\�\�^�^�s��J�J�s��
�E�E�%�L����	�{�+��^�^�^�s�5A�A.	�&A.	c���QQ-oUO29^tt^2oUOV!2UO2UOQ,2PPP2P!)%fhP!9h)r:r9�clear)r r0rXr*r=s&  r�
test_clear�TestDictWatchers.test_clearVsI��
�E�N��
�\�\�^�^�s��J�J�s��
�G�G�I�����y�)��^�^�^�s�4A�A-	�%A-	c���QQ-oUO29^tt^2oUOV!2=UOQ,2PPP2P!)%fhP!9h)r:r9�deallocr<r=s&  r�test_dealloc�TestDictWatchers.test_dealloc]sC��
�E�N��
�\�\�^�^�s��J�J�s������	�{�+��^�^�^�s�%A
�
A	�A	c�$�QQ2oU2oUO29^tt^2oUOV2O2QUmQUmU;UO	,QN2PPP2UO29^tt^2oUOV2O2[]d2FD
oQUmJ	UO	Q,Q,]c**2PPP2P!)%fhK�9h)%fhP!9h)c��\sQs]esQsP!)�0TestDictWatchers.test_object_dict.<locals>.MyObj���__name__�
__module__�__qualname__�__firstlineno__�__static_attributes__rbrr�MyObjraes��Trrir9rAr;zmod:foo:bar)r;rBrP)r r0�__dict__r:r*�range)rri�or�_s&    r�test_object_dict�!TestDictWatchers.test_object_dictds������G��
�\�\�^�^�s��J�J�s�J�J�'��A�E��A�E������H�I���\�\�^�^�s��J�J�s�J�J�'��3�Z����� ����
��-��2�1E�E�F�	�^��^���^�^�s$�?C+�
AC>�+C;	�4C;	�>D	�D	c���-oUO29^tt^2oUOV!2QUQ$UOV!2QUQ$UOQ,2PPP2P!)%fhP!9h)r9r:rA�hmmr;)r r0r5r*r=s&  r�test_unwatch�TestDictWatchers.test_unwatchusZ����
�\�\�^�^�s��J�J�s���A�e�H��L�L�� ��A�e�H����
��/��^�^�^�s�?A%�%A6	�.A6	c	�,�-oUOUOQ59^tt^2oUOV!2[29^tt^2oQUQ$UO	QUO
O2UOUO
O2UO[UO
O2Q2PPP2UO,2PPP2P!)%fhK+9h)%fhP!9h)�rr9r:zFException ignored in PyDict_EVENT_ADDED watcher callback for <dict at �boom!)
r �ERRORr0r�assertIn�
unraisable�err_msg�assertIsNone�objectr&�str�	exc_valuer*�rr/r�cms&   r�
test_error�TestDictWatchers.test_error~s�����
�\�\�t�z�z�\�
*�
*�c��J�J�s��+�-�-�� ��%���
�
�H��M�M�)�)��
�!�!�"�-�-�"6�"6�7�� � ��R�]�]�%<�%<�!=�w�G�.�
���r�"�+�
*�-�-��+�
*�
*�s0�$D�BC/	�D�/C?
�8C?
�:D�D	�D	c	�l�-oUOUOQ59^tt^2oUOV!2[29^tt^2o=UO	[UOO2Q2PPP2PPP2P!)%fhK9h)%fhP!9h)rurv)r rwr0rr&r}ryr~rs&   r�test_dealloc_error�#TestDictWatchers.test_dealloc_error�sw����
�\�\�t�z�z�\�
*�
*�c��J�J�s��+�-�-���� � ��R�]�]�%<�%<�!=�w�G�.�+�
*�-�-��+�
*�
*�s/�$B"�1B	�=B"�B
�B
�B"�"B3	�+B3	c	�x�-o-oUO29^tt^2oUOUOQ59^tt^2oUOV12UOVB2QUQ$QUQ$UOQQ,2PPP2PPP2P!)%fhK9h)%fhP!9h)rur9r:rArqr;�second)r �SECONDr0r*)r�d1rH�wid1�wid2s&    r�test_two_watchers�"TestDictWatchers.test_two_watchers�s���
��
��
�\�\�^�^�t����4�;�;��/�/�4��
�
�4�$��
�
�4�$�!��5�	�!��5�	��"�"�M�8�#<�=�0��^�/�/���^�^�s0�%B(�AB	�B(�B%
�B%
� B(�(B9	�1B9	c	�
�UO29^tt^2oUO[Q29^tt^2UOU]2PPP2PPP2P!)%fhK9h)%fhP!9h)�Cannot watch non-dictionary�r �assertRaisesRegex�
ValueErrorr0�rrs& r�test_watch_non_dict�$TestDictWatchers.test_watch_non_dict�sO��
�\�\�^�^�s��'�'�
�4R�S�S��
�
�3��"�T��^�S�S���^�^��.�A1�A	�A1�A.
�'A.
�)A1�1B	�:B	c�>�-oUO[Q29^tt^2UOPU2PPP2UO[Q29^tt^2UO]U2PPP2P!)%fhKK9h)%fhP!9h�zInvalid dict watcher ID -1zInvalid dict watcher ID 8�r�r�r0�rr/s& r�"test_watch_out_of_range_watcher_id�3TestDictWatchers.test_watch_out_of_range_watcher_id�sn����
�
#�
#�J�0M�
N�
N��J�J�r�1��O�
�
#�
#�J�0L�
M�
M��J�J�q�!��N�
M�O�
N��
M�
M�
M��#�A8�B�8B	�B	�B	�B	c��-oUO[Q29^tt^2UO]U2PPP2P!)%fhP!9h�zNo dict watcher set for ID 3r�r�s& r� test_watch_unassigned_watcher_id�1TestDictWatchers.test_watch_unassigned_watcher_id�s9����
�
#�
#�J�0O�
P�
P��J�J�q�!��Q�
P�
P�
P���?�A	�A	c�H�UO29^tt^2o[2]]{,[21FD;oUO[Q29^tt^2UOV2PPP2J=	PPP2P!)%fhJZ9h)%fhP!9h)�r�)r �
frozendictr|r�r�r5)rr�
wrong_types&  r�test_unwatch_non_dict�&TestDictWatchers.test_unwatch_non_dict�sm��
�\�\�^�^�s�)�|�Q���v�x�@�
��+�+�J�8V�W�W��L�L��1�X�W�A��^�W�W�W���^�^�s/�:B�A<
�&B�<B
�B
�	B�B!	�B!	c�>�-oUO[Q29^tt^2UOPU2PPP2UO[Q29^tt^2UO]U2PPP2P!)%fhKK9h)%fhP!9hr��r�r�r5r�s& r�$test_unwatch_out_of_range_watcher_id�5TestDictWatchers.test_unwatch_out_of_range_watcher_id�sn����
�
#�
#�J�0M�
N�
N��L�L��Q��O�
�
#�
#�J�0L�
M�
M��L�L��A��N�
M�O�
N��
M�
M�
M�r�c��-oUO[Q29^tt^2UO]U2PPP2P!)%fhP!9hr�r�r�s& r�"test_unwatch_unassigned_watcher_id�3TestDictWatchers.test_unwatch_unassigned_watcher_id�s9����
�
#�
#�J�0O�
P�
P��L�L��A��Q�
P�
P�
P�r�c�6�UO[Q29^tt^2UOP2PPP2UO[Q29^tt^2UO]2PPP2P!)%fhKJ9h)%fhP!9hr��r�r�r�rs&r�"test_clear_out_of_range_watcher_id�3TestDictWatchers.test_clear_out_of_range_watcher_id�si��
�
#�
#�J�0M�
N�
N����r�"�O�
�
#�
#�J�0L�
M�
M����q�!�N�
M�O�
N��
M�
M�
M�s#�A4�B�4B	�=B	�B	�B	c��UO[Q29^tt^2UO]2PPP2P!)%fhP!9hr�r�r�s&r� test_clear_unassigned_watcher_id�1TestDictWatchers.test_clear_unassigned_watcher_id��4��
�
#�
#�J�0O�
P�
P����q�!�Q�
P�
P�
P���<�A
	�A
	rb)%rdrerfrg�EVENTSrwr�rrrr r*r0r5r>rCrIrLrQrUrYr]rnrrr�r�r�r�r�r�r�r�r�r�r�rh�__classdictcell__��
__classdict__s@rr	r	s�����
�F�
�E�
�F�%�0�1��!�$��$�+�%�'�0�0�*�#�,�,�*�,�G�"0�
#�H�	>�#�
��
2���
"�"�"rr	c��`�\sQs]�sn]s]s]s]s]s\1Qks	Qs
\\1Qk2sQs
QsQsQsQsQ	sQ
sQsQsQ
sQsQsQsQsQsQsQsQsQsQs Qs!Qs"Qs#Qs$Us%P!)�TestTypeWatchersc�.�[OU2!r)r�add_type_watcherr
s&&rr�TestTypeWatchers.add_watcher�rrc�2�[OU2P!r)r�clear_type_watcherrs&&rr�TestTypeWatchers.clear_watcher�rrc#� �UOU2oUw�UOU2P!SOS2h9h3hrrrs&& rr �TestTypeWatchers.watcher�r"r#c�R�[O2oUOV!2P!r)r�get_type_modified_eventsr&r's&& rr*�TestTypeWatchers.assert_events�s���3�3�5������*rc�2�[OV2P!r)r�
watch_type�rr�ts&&&rr0�TestTypeWatchers.watch�r2rc�2�[OV2P!r)r�unwatch_typer�s&&&rr5�TestTypeWatchers.unwatch�r7rc���QQ2oUO29^tt^2oUOV!2QUmUOU,2PPP2P!)%fhP!9h)c��\sQs]�sQsP!)�+TestTypeWatchers.test_watch_type.<locals>.Crbrcrbrr�Cr�����rr�r9�r r0r:r*�rr�rs&  r�test_watch_type� TestTypeWatchers.test_watch_type�sC���
�
�\�\�^�^�s��J�J�s���A�E�����s�#��^�^�^�s�+A�A*	�"A*	c���QQ2oUO29^tt^2oUOV!2QUmQUmUO	U,2PPP2P!)%fhP!9h)c��\sQs]�sQsP!)�2TestTypeWatchers.test_event_aggregation.<locals>.Crbrcrbrrr�r��r�rr�r9rA)r r0r:r9r*r�s&  r�test_event_aggregation�'TestTypeWatchers.test_event_aggregation�sJ���
�
�\�\�^�^�s��J�J�s���A�E��A�E�����s�#��^�^�^�s�2A � A1	�)A1	c� �QQ2oUO29^tt^2oUOV!2QUmUOUOQ2QUmUOV,2PPP2P!)%fhP!9h)c��\sQsQsQsP!)�:TestTypeWatchers.test_lookup_resets_aggregation.<locals>.C�rbrcrbrrr�r�r�rr�r9rA)r r0r:r&r9r*r�s&  r�test_lookup_resets_aggregation�/TestTypeWatchers.test_lookup_resets_aggregations^���
�
�\�\�^�^�s��J�J�s���A�E����Q�U�U�E�*��A�E�����v�&��^�^�^�s�AA<�<B
	�B
	c�f�QQ2oUO29^tt^2oUOV!2QUmUOUOQ2UO	U,2UOV!2QUmUO	U,2PPP2P!)%fhP!9h)c��\sQsQsQsP!)�-TestTypeWatchers.test_unwatch_type.<locals>.C�rbrcrbrrr�r�r�rr�r9rA)r r0r:r&r*r5r9r�s&  r�test_unwatch_type�"TestTypeWatchers.test_unwatch_typesz���
�
�\�\�^�^�s��J�J�s���A�E����Q�U�U�E�*�����s�#��L�L�� ��A�E�����s�#��^�^�^�s�A1B�B0	�(B0	c	��QQ2oUO29^tt^2oUO29^tt^2oUOV12QUmUOUOQ2UO	U,2PPP2QUmUO	U,2PPP2P!)%fhK39h)%fhP!9h)c��\sQsQsQsP!)�.TestTypeWatchers.test_clear_watcher.<locals>.C�rbrcrbrrr�r�r�rr�r9rA)r r0r:r&r*r9)rr�rmrs&   r�test_clear_watcher�#TestTypeWatchers.test_clear_watchers����
�
�\�\�^�^�q������3��
�
�3�"����� � �����.��"�"�A�3�'�	 �
�A�E�����s�#��^�����^�^�s/�C�AB/	�!C�/B?
�8B?
�:C�C	�C	c���QQ2oQQU2oUO29^tt^2oUOV22QUmUOU,2PPP2P!)%fhP!9h)c��\sQsQsQsP!)�4TestTypeWatchers.test_watch_type_subclass.<locals>.C�$rbrcrbrrr�r�$r�rr�c��\sQsQsQsP!)�4TestTypeWatchers.test_watch_type_subclass.<locals>.D�%rbrcrbrr�Dr�%s��Drr�r9r�)rr�r�rs&   r�test_watch_type_subclass�)TestTypeWatchers.test_watch_type_subclass#sK���
����
�\�\�^�^�s��J�J�s���A�E�����s�#��^�^�^�s�+A$�$A5	�-A5	c	�J�QQ2oUOUOQ59^tt^2oUOV!2[29^tt^2oQUmUOUOOQU802UOUOOP2UO[UOO2Q2PPP2UO,2PPP2P!)%fhK+9h)%fhP!9h)c��\sQsQsQsP!)�&TestTypeWatchers.test_error.<locals>.C�,rbrcrbrrr�r�,r�rr�rur9z2Exception ignored in type watcher callback #1 for rv)
r rwr0rr:r&ryrz�assertIsr|r}r~r*)rr�rr�s&   rr��TestTypeWatchers.test_error+s����
�
�\�\�t�z�z�\�
*�
*�c��J�J�s��+�-�-������ � ��M�M�)�)�H���N���
�
�b�m�m�2�2�D�9�� � ��R�]�]�%<�%<�!=�w�G�.�
���r�"�+�
*�-�-��+�
*�
*�s0�$D�BC>	�D�>D
�D
�	D�D"	�D"	c	���QQ2oQQ2oUO29^tt^2oUOUOQ59^tt^2oUOV42UOV12UOVB2QUmQUmUO
V,,2PPP2PPP2P!)%fhK9h)%fhP!9h)c��\sQsQsQsP!)�.TestTypeWatchers.test_two_watchers.<locals>.C1�:rbrcrbrr�C1r:���$rrc��\sQsQsQsP!)�.TestTypeWatchers.test_two_watchers.<locals>.C2�;rbrcrbrr�C2r
;rrrrur9rA)r �WRAP�assertNotEqualr0r:rqr*)rrrr�r�s&    rr��"TestTypeWatchers.test_two_watchers9s�������
�\�\�^�^�t����4�9�9��-�-���#�#�D�/��
�
�4�$��
�
�4�$��������"�"�B��:�.�
.��^�-�-���^�^�s0�%C
�AB:	�(C
�:C

�C

�C
�
C	�C	c�B�QQ2o[29^tt^2oPoV0O]*
6c"UOUO22oJ8UO	V12QUmUO
U,2PPP2P!)%fhP!9h)c��\sQsQsQsP!)�-TestTypeWatchers.test_all_watchers.<locals>.C�Frbrcrbrrr�rFr�rr�r9)r�TYPE_MAX_WATCHERS�
enter_contextr r0r:r*)rr��stack�last_wids&   r�test_all_watchers�"TestTypeWatchers.test_all_watchersEsm���
�
�[�[�E��H��3�3�a�7�7� �.�.�t�|�|�~�>���J�J�x�#��A�E�����s�#��[�[�[�s�B
�AB
�
B	�B	c	�
�UO29^tt^2oUO[Q29^tt^2UOU]2PPP2PPP2P!)%fhK9h)%fhP!9h�zCannot watch non-typer�r�s& r�test_watch_non_type�$TestTypeWatchers.test_watch_non_typeQsO��
�\�\�^�^�s��'�'�
�4L�M�M��
�
�3��"�N��^�M�M���^�^�r�c�b�QQ2oUO[Q29^tt^2UOPU2PPP2UO[Q29^tt^2UOUOU2PPP2P!)%fhKU9h)%fhP!9h)c��\sQsQsQsP!)�>TestTypeWatchers.test_watch_out_of_range_watcher_id.<locals>.C�Wrbrcrbrrr�r Wr�rr��Invalid type watcher ID -1�Invalid type watcher ID 8)r�r�r0r�rr�s& rr��3TestTypeWatchers.test_watch_out_of_range_watcher_idVst���
�
�
#�
#�J�0M�
N�
N��J�J�r�1��O�
�
#�
#�J�0L�
M�
M��J�J�t�-�-�q�1�N�
M�O�
N��
M�
M�
M��#�B
�#B�
B	�B	�B.	�&B.	c��QQ2oUO[Q29^tt^2UO]U2PPP2P!)%fhP!9h)c��\sQsQsQsP!)�<TestTypeWatchers.test_watch_unassigned_watcher_id.<locals>.C�^rbrcrbrrr�r)^r�rr��No type watcher set for ID 1r�r$s& rr��1TestTypeWatchers.test_watch_unassigned_watcher_id]s9���
�
�
#�
#�J�0O�
P�
P��J�J�q�!��Q�
P�
P�
P���A�A	�A	c	�
�UO29^tt^2oUO[Q29^tt^2UOU]2PPP2PPP2P!)%fhK9h)%fhP!9hr)r r�r�r5r�s& r�test_unwatch_non_type�&TestTypeWatchers.test_unwatch_non_typebsO��
�\�\�^�^�s��'�'�
�4L�M�M����S�!�$�N��^�M�M���^�^�r�c�b�QQ2oUO[Q29^tt^2UOPU2PPP2UO[Q29^tt^2UOUOU2PPP2P!)%fhKU9h)%fhP!9h)c��\sQsQsQsP!)�@TestTypeWatchers.test_unwatch_out_of_range_watcher_id.<locals>.C�hrbrcrbrrr�r3hr�rr�r"r#)r�r�r5rr$s& rr��5TestTypeWatchers.test_unwatch_out_of_range_watcher_idgst���
�
�
#�
#�J�0M�
N�
N��L�L��Q��O�
�
#�
#�J�0L�
M�
M��L�L��/�/��3�N�
M�O�
N��
M�
M�
M�r&c��QQ2oUO[Q29^tt^2UO]U2PPP2P!)%fhP!9h)c��\sQsQsQsP!)�>TestTypeWatchers.test_unwatch_unassigned_watcher_id.<locals>.C�orbrcrbrrr�r8or�rr�r+r�r$s& rr��3TestTypeWatchers.test_unwatch_unassigned_watcher_idns9���
�
�
#�
#�J�0O�
P�
P��L�L��A��Q�
P�
P�
P�r-c�J�UO[Q29^tt^2UOP2PPP2UO[Q29^tt^2UOUO2PPP2P!)%fhKT9h)%fhP!9h)r"r#)r�r�rrr�s&rr��3TestTypeWatchers.test_clear_out_of_range_watcher_idsso��
�
#�
#�J�0M�
N�
N����r�"�O�
�
#�
#�J�0L�
M�
M����t�5�5�6�N�
M�O�
N��
M�
M�
M�s#�A>�B�>B	�B	�B"	�B"	c��UO[Q29^tt^2UO]2PPP2P!)%fhP!9h)r+r�r�s&rr��1TestTypeWatchers.test_clear_unassigned_watcher_idyr�r�c�"�UOUOQ59^tt^2oQQ2oUOV2=[2[O2oUO
QU2PPP2P!)%fhP!9h)ruc��\sQsQsQsP!)�<TestTypeWatchers.test_watch_type_dealloc.<locals>.MyTestType�rbrcrbrr�
MyTestTyperA�s��drrC)r �NAMEr0rrr�rx)rrrC�eventss&   r�test_watch_type_dealloc�(TestTypeWatchers.test_watch_type_dealloc}s`���\�\�t�y�y�\�
)�
)�S�"�"��J�J�s�'���L��7�7�9�F��M�M�,��/�
*�
)�
)�
)�s�A
A=�=B	�B	c	��UOUOQ59^tt^2oQQ2oUOV2[29^tt^2o=[	2UO[
UOO2Q2PPP2PPP2P!)%fhK9h)%fhP!9h)ruc��\sQsQsQsP!)�CTestTypeWatchers.test_watch_type_dealloc_error.<locals>.MyTestType2�rbrcrbrr�MyTestType2rJ�s��trrLrv)	r rwr0rrr&r}ryr~)rrrLr�s&   r�test_watch_type_dealloc_error�.TestTypeWatchers.test_watch_type_dealloc_error�s��
�\�\�t�z�z�\�
*�
*�c�#�#��J�J�s�(�+�-�-������ � ��R�]�]�%<�%<�!=�w�G�.�+�
*�.�-��+�
*�
*�s/�.B4�;B!	�B4�!B1
�*B1
�,B4�4C	�=C	c
�`�UO[Q29^tt^2[29^tt^2o[UO]*2FD"oUOUO
22J$	PPP2PPP2P!)%fhK9h)%fhP!9h)zno more type watcher IDs)r��RuntimeErrorrrkrrr )rrrms&  r�test_no_more_ids_available�+TestTypeWatchers.test_no_more_ids_available�sn��
�
#�
#�L�2M�
N�
N������t�5�5��9�:�A��'�'�����7�;��O�
N����O�
N�
N�s/�B�AB		�7B�	B
�B
�B�B-	�%B-	rb)&rdrerfrg�TYPESrwr
rDrrrrr r*r0r5r�r�r�r�r�r�r�r�rrr�r�r/r�r�r�r�rFrMrQrhr�r�s@rr�r��s�����
�E�
�E��D��D���$�0�1�� �$��$�+�%�'�$�$�	'�	$�$�$�#�
/�
$�#�
2��
%�
4��
7�"�
0�H�8�8rr�c�\`�\sQsQsn\Q2sQsQsQsQs	Qs
QsQ	sQ
s
UsP!)�TestCodeObjectWatchers�c#� �[OU2oUw�[OU2P![OS2h9h3hr)r�add_code_watcher�clear_code_watcher)r�
which_watcherrs&& r�code_watcher�#TestCodeObjectWatchers.code_watcher�s;����(�(��7��	.��I��(�(��-��I�(�(��-���A�6�A�A
�
Ac�D�[2UOU[O]22UOU[O	]22UOU[O]22UOU[O	]22P!�r)rr&r�#get_code_watcher_num_created_events�%get_code_watcher_num_destroyed_events)r�
exp_created_0�exp_destroyed_0�
exp_created_1�exp_destroyed_1s&&&&&r�assert_event_counts�*TestCodeObjectWatchers.assert_event_counts�s���������9�H�H��K�	M�����Y�L�L�Q�O�	Q�����9�H�H��K�	M�����Y�L�L�Q�O�	Qrc
�T�UO]]]]2[OQQ]2oUO]]]]2=UO]]]]2UO]29^tt^2UO]]]]2[OQQ]2oUO]]]]2=UO]]]]2UO]29^tt^2UO]]]]2[OQQ]2oUO]]]]2=UO]]]]2PPP2PPP2[OQQ]2oUO]]]]2=UO]]]]2P!)%fhKZ9h)%fhKe9h)r�
test_watchers�dummy1�dummy2�dummy3�dummy4)rfr�
code_newemptyr[)r�co1�co2�co3�co4s&    r�"test_code_object_events_dispatched�9TestCodeObjectWatchers.test_code_object_events_dispatched�s���� � ��A�q�!�,��%�%�o�x��C��� � ��A�q�!�,��� � ��A�q�!�,��
�
�q�
!�
!��$�$�Q��1�a�0��)�)�/�8�Q�G�C��$�$�Q��1�a�0���$�$�Q��1�a�0��"�"�1�%�%��(�(��A�q�!�4��-�-�o�x��K���(�(��A�q�!�4���(�(��A�q�!�4�&�"� �%�%�o�x��C��� � ��A�q�!�,��� � ��A�q�!�,�&�%��"�
!�s2�/A.F�AF	�2F�F
�
F
�F�F'	� F'	c	��UO]29^tt^2[29^tt^2o[OQQ]2oUO	UO
OQU802UOUO
O2UO	[UO
O2Q2PPP2PPP2P!)%fhK9h)%fhP!9h)�ri�dummy0z?Exception ignored in PY_CODE_EVENT_CREATE watcher callback for rv)r[rrrnr&ryrzr{r|r}r~)rr��cos&  rr��!TestCodeObjectWatchers.test_error�s���
�
�
�q�
!�
!�+�-�-���,�,�_�h��J��� � ��M�M�)�)�A�AC��H��
�!�!�"�-�-�"6�"6�7�� � ��R�]�]�%<�%<�!=�w�G�.�"�
!�-�-��"�
!�
!�s/�C)�BC	�C)�C&
�C&
�!C)�)C:	�2C:	c	�r�[OQQ]2oUO]29^tt^2[29^tt^2o=[	2UO[
UOO2Q2PPP2PPP2P!)%fhK9h)%fhP!9h)rirwrv)	rrnr[rrr&r}ryr~)rrxr�s&  rr��)TestCodeObjectWatchers.test_dealloc_error�sy��
�
$�
$�_�h��
B��
�
�
�q�
!�
!�+�-�-������ � ��R�]�]�%<�%<�!=�w�G�	.�"�
!�-�-��"�
!�
!�s/�B%�;B	�B%�B"
�B"
�B%�%B6	�.B6	c�F�UO[Q29^tt^2[OP2PPP2UO[Q29^tt^2[O]2PPP2P!)%fhKN9h)%fhP!9h)zInvalid code watcher ID -1zInvalid code watcher ID 8�r�r�rrYr�s&rr��9TestCodeObjectWatchers.test_clear_out_of_range_watcher_id��i��
�
#�
#�J�0M�
N�
N��(�(��,�O�
�
#�
#�J�0L�
M�
M��(�(��+�N�
M�O�
N��
M�
M�
M��#�A<�B�<B	�B	�B 	�B 	c��UO[Q29^tt^2[O]2PPP2P!)%fhP!9h)zNo code watcher set for ID 1r}r�s&rr��7TestCodeObjectWatchers.test_clear_unassigned_watcher_id��4��
�
#�
#�J�0O�
P�
P��(�(��+�Q�
P�
P�
P���A�A	�	A	c��UO[Q29^tt^2[O2PPP2P!)%fhP!9h)z"no more code watcher IDs available)r�rPr�allocate_too_many_code_watchersr�s&r�test_allocate_too_many_watchers�6TestCodeObjectWatchers.test_allocate_too_many_watchers�s2��
�
#�
#�L�2W�
X�
X��5�5�7�Y�
X�
X�
X���?�A	�A	rb)rdrerfrgrr[rfrsr�r�r�r�r�rhr�r�s@rrUrU�sC�����.��.�
Q�-�BH�H�,�,�8�8rrUc�\`�\sQsQsn\Q2sQsQsQsQs	Qs
QsQ	sQ
s
UsP!)�TestFuncWatchers��c#� �[OU2oPw�[OU2P![OS2h9h3hr)r�add_func_watcher�clear_func_watcher)r�funcrs&& rr�TestFuncWatchers.add_watcher�s9����(�(��.��	.���(�(��-��I�(�(��-�r]c�`�,nU1QkoUOU29^tt^2QoUO[OUP1R2[	U2oUO
OoVBmUO[OV$1R2QoVRmUO[OV%1R2Qo[OV%2UO[OV%1R2Q]{-oVbmUO[OV&1R2QQ-o[OV&2UO[OV&1R2QoVrmUO[OV'1R2,n=UO[O UP1R2PPP2P!)%fhP!9h)c�,:�ROU2P!r��append)�argsrEs*�rr �=TestFuncWatchers.test_func_events_dispatched.<locals>.watcher�s����M�M�$�rc��P!rrbrbrr�myfunc�<TestFuncWatchers.test_func_events_dispatched.<locals>.myfuncs��r��rzfoo.bar)�{)r�)rrxr�PYFUNC_EVENT_CREATE�id�test_func_events_dispatched�__code__�PYFUNC_EVENT_MODIFY_CODE�__defaults__�PYFUNC_EVENT_MODIFY_DEFAULTS�set_func_defaults_via_capi�__kwdefaults__�PYFUNC_EVENT_MODIFY_KWDEFAULTS�set_func_kwdefaults_via_capirf�PYFUNC_EVENT_MODIFY_QUALNAME�PYFUNC_EVENT_DESTROY)	rr r��	myfunc_id�new_code�new_defaults�new_kwdefaults�new_qualnamerEs	&       @rr��,TestFuncWatchers.test_func_events_dispatched�s�����	 ��
�
�g�
&�
&�
��M�M�9�8�8�&�$�G��P��6�
�I��7�7�@�@�H�&�O��M�M�9�=�=�v�P�RX�Y�!�L�".���M�M�9�A�A�6�X�Z`�a�!�L��0�0��F��M�M�9�A�A�6�X�Z`�a�$�c�]�N�$2�!��M�M�9�C�C�V�\�^d�e�$�c�]�N��2�2�6�J��M�M�9�C�C�V�\�^d�e�$�L�".���M�M�9�A�A�6�X�Z`�a��F���M�M�9�9�9�9�d�K�V�T�C'�
&�
&�
&�s�F
F8�8G		�G		c	�v``�,nU1Qko,nU1QkoUOU29^tt^2UOU29^tt^2Qo[OUP1oUOUR2UOUR2PPP2PPP2P!)%fhK9h)%fhP!9h)c�,:�ROU2P!rr�)r��events0s*�r�
first_watcher�>TestFuncWatchers.test_multiple_watchers.<locals>.first_watcher'�����N�N�4� rc�,:�ROU2P!rr�)r��events1s*�r�second_watcher�?TestFuncWatchers.test_multiple_watchers.<locals>.second_watcher+r�rc��P!rrbrbrrr��7TestFuncWatchers.test_multiple_watchers.<locals>.myfunc0���r)rrr�rx)rr�r�r��eventr�r�s&    @@r�test_multiple_watchers�'TestFuncWatchers.test_multiple_watchers%s������	!���	!��
�
�m�
,�
,��!�!�.�1�1��#�6�6���E���
�
�e�W�-��
�
�e�W�-�
2�-�
,�1�1��-�
,�
,�s/�B'�;B	�B'�B$
�B$
�B'�'B8	�0B8	c�`�QQ[2nU1QkoUOU29^tt^2[29^tt^2oQoUOUOO
Q[
U2]P02UOUOO2PPP2PPP2P!)%fhK9h)%fhP!9h)c��\sQsQsQsP!)�;TestFuncWatchers.test_watcher_raises_error.<locals>.MyError�8rbrcrbrr�MyErrorr�8���rr�c�:�RQ2g�ztesting 123rb�r�r�s*�rr �;TestFuncWatchers.test_watcher_raises_error.<locals>.watcher;�����-�(�(rc��P!rrbrbrrr��:TestFuncWatchers.test_watcher_raises_error.<locals>.myfunc@r�rzBException ignored in PyFunction_EVENT_CREATE watcher callback for )	�	Exceptionrrr&ryrz�reprr{r|)rr r�r�r�s&   @r�test_watcher_raises_error�*TestFuncWatchers.test_watcher_raises_error7s����	�i�	�	)��
�
�g�
&�
&�+�-�-���� � ��M�M�)�)�D�DH��L�QR�SU�DV�CW�Y��
�!�!�"�-�-�"6�"6�7�.�'�
&�-�-��'�
&�
&�s0�C�AB4	�"C�4C
�=C
�?C�C	�C	c	�P`�QQ[2nU1QkoQoUOU29^tt^2[29^tt^2o=UOUOO
R2PPP2PPP2P!)%fhK9h)%fhP!9h)c��\sQsQsQsP!)�CTestFuncWatchers.test_dealloc_watcher_raises_error.<locals>.MyError�Krbrcrbrrr�r�Kr�rr�c�:�RQ2gr�rbr�s*�rr �CTestFuncWatchers.test_dealloc_watcher_raises_error.<locals>.watcherNr�rc��P!rrbrbrrr��BTestFuncWatchers.test_dealloc_watcher_raises_error.<locals>.myfuncQs��r)r�rr�assertIsInstanceryr~)rr r�r�r�s&   @r�!test_dealloc_watcher_raises_error�2TestFuncWatchers.test_dealloc_watcher_raises_errorJst���	�i�	�	)�	��
�
�g�
&�
&�+�-�-����%�%�b�m�m�&=�&=�w�G�.�'�
&�-�-��'�
&�
&�s/�B�(B	�/B�B
�
B
�B�B%	�B%	c�F�UO[Q29^tt^2[OP2PPP2UO[Q29^tt^2[O]2PPP2P!)%fhKN9h)%fhP!9h)zinvalid func watcher ID -1zinvalid func watcher ID 8�r�r�rr�r�s&rr��3TestFuncWatchers.test_clear_out_of_range_watcher_idZrr�c��UO[Q29^tt^2[O]2PPP2P!)%fhP!9h)zno func watcher set for ID 1r�r�s&rr��1TestFuncWatchers.test_clear_unassigned_watcher_id`r�r�c��UO[Q29^tt^2[O2PPP2P!)%fhP!9h)zno more func watcher IDs)r�rPr�allocate_too_many_func_watchersr�s&rr��0TestFuncWatchers.test_allocate_too_many_watchersds2��
�
#�
#�L�2M�
N�
N��5�5�7�O�
N�
N�
N�r�rb)rdrerfrgrrr�r�r�r�r�r�r�rhr�r�s@rr�r��sB�����.��.�&U�P.�$8�&H� ,�,�8�8rr�c�\`�\sQsQsn\Q2sQsQsQsQs	Qs
QsQ	sQ
s
UsP!)�TestContextObjectWatchers�ic#� �[OU2o[OU2oUw�[O	U2P![cPoK,h9h[O	S2h9h3hr)r�add_context_watcher�get_context_switchesr��clear_context_watcher)rrZr�switchess&&  r�context_watcher�)TestContextObjectWatchers.context_watcherjsh����+�+�M�:��	� �5�5�m�D�H�	1��N��+�+�C�0���	��H�	��

�+�+�C�0�s>�A9�A�A�A9�	A�A�A9�A�A9�A6�6A9c��UO[[O]22U2UO[[O]22U2P!r_)r&�lenrr�)r�want_0�want_1s&&&rrf�-TestContextObjectWatchers.assert_event_countsvsB������Y�;�;�A�>�?��H�����Y�;�;�A�>�?��Hrc	���UO]]2[O2oUOUO]]2UO]]2UO	]29^tt^2UO]]2UOUO]]2UO]]2UO	]29^tt^2UO]]2UOUO]]2UO]]2PPP2PPP2UOUO]]2UO]]2P!)%fhKI9h)%fhKT9hr_)rf�contextvars�copy_context�runr�)r�ctxs& r�%test_context_object_events_dispatched�?TestContextObjectWatchers.test_context_object_events_dispatchedzs��� � ��A�&��&�&�(������(�(�!�Q�/�� � ��A�&��
!�
!�!�
$�
$��$�$�Q��*��G�G�D�,�,�a��3��$�$�Q��*��%�%�a�(�(��(�(��A�.�����0�0�!�Q�7��(�(��A�.�)�
%�	����(�(�!�Q�/�� � ��A�&�)�(��
%�
$�s2�1AE"�AE	�E"�E
�E
�E"�"E2	�+E2	c	�```�[O2o[O2n,nUUU1QkoUOU2RORTt,tFDp3OMJ	toRU,Tt,tFD	oQU80MJ	to2RORTt,tFDo[UO2MJ	toQQ,2PnP!ttohttohttohPnh9h)c	�6:`�RO]29^tt^2[29^tt^2nROUU1Qk2RORO2PPP2PPP2P!)%fhK9h)%fhP!9h)rvc�<:�RORO2!r)r�ry)r��unraisabless��r�<lambda>�RTestContextObjectWatchers.test_callback_error.<locals>._in_outer.<locals>.<lambda>�s���+�*<�*<�R�]�]�*Kr)r�rr�r�ry)r��	ctx_innerrr�s@���r�	_in_outer�@TestContextObjectWatchers.test_callback_error.<locals>._in_outer�s^����%�%�a�(�(�/�1�1�R��M�M�"K�L��&�&�r�}�}�5�2�)�(�1�1��)�(�(�s.�B�2A4	�"B�4B
�=B
�?B�B	�B	z>Exception ignored in Py_CONTEXT_SWITCHED watcher callback for rv)r�r�r�r&rzr}r~)r�	ctx_outerr�xr�rr�sf    @@r�test_callback_error�-TestContextObjectWatchers.test_callback_error�s�����,�,�.�	��,�,�.�	���	6�
	��M�M�)�$�����=��A�i�i��=�+4�Y�)?�A�)?�#�6�69�W�>�)?�A�
B�
����D��1�c�!�+�+�.��D�%�w�/�
1��K��>��A��E���K�s5�C�C
�/C�6C
�C� C�<
C�
C�Cc�F�UO[Q29^tt^2[OP2PPP2UO[Q29^tt^2[O]2PPP2P!)%fhKN9h)%fhP!9h)zInvalid context watcher ID -1zInvalid context watcher ID 8�r�r�rr�r�s&rr��<TestContextObjectWatchers.test_clear_out_of_range_watcher_id�si��
�
#�
#�J�0P�
Q�
Q��+�+�B�/�R�
�
#�
#�J�0O�
P�
P��+�+�A�.�Q�
P�R�
Q��
P�
P�
P�r�c��UO[Q29^tt^2[O]2PPP2P!)%fhP!9h)zNo context watcher set for ID 1rr�s&rr��:TestContextObjectWatchers.test_clear_unassigned_watcher_id�s4��
�
#�
#�J�0R�
S�
S��+�+�A�.�T�
S�
S�
S�r�c��UO[Q29^tt^2[O2PPP2P!)%fhP!9h)z%no more context watcher IDs available)r�rPr�"allocate_too_many_context_watchersr�s&rr��9TestContextObjectWatchers.test_allocate_too_many_watchers�s2��
�
#�
#�L�2Z�
[�
[��8�8�:�\�
[�
[�
[�r�c��[O2o[O2UO	]29^tt^2oUOQ2PPP2UO
WUP,2P!)%fhK&9h)rc��P!rrbrbrrr��BTestContextObjectWatchers.test_exit_base_context.<locals>.<lambda>�s��Dr)r��Contextr�clear_context_stackr�r�r&)rr�r�s&  r�test_exit_base_context�0TestContextObjectWatchers.test_exit_base_context�s]���!�!�#���%�%�'�
�
!�
!�!�
$�
$���G�G�L�!�%�����C��;�/�%�
$�s�A5�5B	�>B	rb)rdrerfrgrr�rfr�rr�r�r�rrhr�r�s@rr�r�is@�����	1��	1�I�'�4�./�/�;�0�0rr��__main__)�unittestr��
contextlibrr�test.supportrrr�
import_moduler�TestCaser	r�rUr�r�rd�mainrbrr�<module>rs�����0���
�'�'��4�	�}"�x�(�(�}"�@H8�x�(�(�H8�VX8�X�.�.�X8�vr8�x�(�(�r8�jU0�� 1� 1�U0�n�z���M�M�O�r

Youez - 2016 - github.com/yon3zu
LinuXploit