403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.94
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/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python315/Lib/test/__pycache__/test_bdb.cpython-315.opt-1.pyc
R
>lqjm�c�x�Qs]PHs]PHs]PHs]PHs]PHs]PHs]PH s]QH$G
s
]QH,GsG
s
]QH8Gs]QH8Gs]QH8GsQQ\2sQQ	\2sQ
Q\2sQQ
\2s]sQsQsQQ\O42sQQ\2sQQ2sQ,Qks\
Q2s\P
P1Qks Qs!\!Q*s"Qs#Qs$Qs%Qs&QQ \ON2s(Q!Q"\(2s)Q#Q$\(2s*Q%Q&\(2s+Q'Q(\(2s,Q)Q*\ON2s-\.Q+6Xc\O^2P!P!)-a8Test the bdb module.

A test defines a list of tuples that may be seen as paired tuples, each
pair being defined by 'expect_tuple, set_tuple' as follows:

    ([event, [lineno[, co_name[, eargs]]]]), (set_type, [sargs])

* 'expect_tuple' describes the expected current state of the Bdb instance.
  It may be the empty tuple and no check is done in that case.
* 'set_tuple' defines the set_*() method to be invoked when the Bdb
  instance reaches this state.

Example of an 'expect_tuple, set_tuple' pair:

    ('line', 2, 'tfunc_main'), ('step', )

Definitions of the members of the 'expect_tuple':
    event:
        Name of the trace event. The set methods that do not give back
        control to the tracer [1] do not trigger a tracer event and in
        that case the next 'event' may be 'None' by convention, its value
        is not checked.
        [1] Methods that trigger a trace event are set_step(), set_next(),
        set_return(), set_until() and set_continue().
    lineno:
        Line number. Line numbers are relative to the start of the
        function when tracing a function in the test_bdb module (i.e. this
        module).
    co_name:
        Name of the function being currently traced.
    eargs:
        A tuple:
        * On an 'exception' event the tuple holds a class object, the
          current exception must be an instance of this class.
        * On a 'line' event, the tuple holds a dictionary and a list. The
          dictionary maps each breakpoint number that has been hit on this
          line to its hits count. The list holds the list of breakpoint
          number temporaries that are being deleted.

Definitions of the members of the 'set_tuple':
    set_type:
        The type of the set method to be invoked. This may
        be the type of one of the Bdb set methods: 'step', 'next',
        'until', 'return', 'continue', 'break', 'quit', or the type of one
        of the set methods added by test_bdb.Bdb: 'ignore', 'enable',
        'disable', 'clear', 'up', 'down'.
    sargs:
        The arguments of the set method if any, packed in a tuple.
)�contextmanager)�islice�repeat)�
import_helper)�	os_helper)�
patch_listc��\sQs]AsQsP!)�BdbException�)�__name__�
__module__�__qualname__�__firstlineno__�__static_attributes__r	��"C:\Python315\\Lib\test\test_bdb.pyrrAs��trrc��\sQs]BsQsQsP!)�BdbErrorz!Error raised by the Bdb instance.r	�r
rrr
�__doc__rr	rrrrBs��Errc��\sQs]CsQsQsP!)�BdbSyntaxErrorzSyntax error in the test case.r	rr	rrrrCs��$Hrrc��\sQs]DsQsQsP!)�BdbNotExpectedErrorzUnexpected result.r	rr	rrrrDs��)Arrc�D�[OO2P!�N)�_bdb�
Breakpoint�clearBreakpointsr	rr�reset_BreakpointrLs���O�O�$�$�&rc�B�[OOTt,tFDp%fJUMJ	ooU%fP!P
oSFD�oU%fQoP	oUO%cQLQoUO%cQLQoWQUO
VEUOUO[OOUO2UO1**
oUO%cUQUO80*
oUQ*
oJ�	W!ttoh)	�z!BpNum Temp Enb Hits Ignore Where
zyes zno  �yeszno z%-5d %s %s %-4d %-6d at %s:%dz
	stop only if �
)rr�
bpbynumber�	temporary�enabled�number�hits�ignore�os�path�basename�file�line�cond)�bp�bp_list�header_added�info�disp�enabs      r�info_breakpointsr5Os���!�_�_�7�7�>�7�r�2�r�r�7�G�>����L����7�D��L�����v�6���
�
�
�u����0��Y�Y��B�G�G�R�Y�Y��W�W�%�%�b�g�g�.����9�9�	:���7�7�7��R�W�W�6�6�D�������K��%?s
�D�Dc�x``�\sQs]dsnQsU1QksQU1QkksU1QksQsQs	Qs
QsQ	sQ
s
QsUsU9s!)
�Bdbz$Extend Bdb to enhance test coverage.c�4:�PUm[RU_	VU2!r)�	currentbp�super�trace_dispatch)�self�frame�event�arg�	__class__s&&&&�rr;�Bdb.trace_dispatchgs�������w�%�e�C�8�8rc�:�[U[2%cwU[6Xc[2oL%[O
UPQ2oUOo[VV2oUOo	U	OoU	OoU	Oo[RU_5VUVEQ5o
[U
[2%c[U
2gU
!)N)r$r.�funcname���)�
isinstance�str�__file__�globals�	importlib�
import_module�__dict__�eval�__code__�co_filename�co_firstlineno�co_namer:�	set_breakr)r<�filename�linenor$r.rC�globals_�module�func�code�resr@s&&&&&&     �rrQ�
Bdb.set_breakks�����h��$�$��8�#�"�9��"�0�0��#�2��?��!�?�?����+�D��=�=�D��'�'�H��(�(�F��|�|�H��g���I�&*� �?���c�3����3�-���
rc�:�[RU_V2vUmUmUOUO*]*UmUOUO1!��)r:�	get_stack�stack�indexr=)r<�f�tr@s&&&�rr]�
Bdb.get_stacksG���!&��!2�1�!8���
�D�J��Z�Z��
�
�+�A�.��
��z�z�4�:�:�%�%rc�\�UOU2oU9O]*
tmP!)z8Increment the ignore count of Breakpoint number 'bpnum'.)�get_bpbynumberr(�r<�bpnumr/s&& r�
set_ignore�Bdb.set_ignore�s��
�
 �
 ��
'��
�	�	�Q��	rc�8�UOU2oP	UmP!)T�rdr%res&& r�
set_enable�Bdb.set_enable�s��
�
 �
 ��
'����
rc�8�UOU2oP
UmP!)Frjres&& r�set_disable�Bdb.set_disable�s��
�
 �
 ��
'����
rc�P�UOV2oU%c[U2gP!r)�clear_breakr)r<�fnamerS�errs&&& r�	set_clear�
Bdb.set_clear�s$�����u�-����3�-��rc���UO%f[Q2gU9O]*tmUOUO*]*UmP!)zMove up in the frame stack.zOldest frame)r_rr^r=�r<s&r�set_up�
Bdb.set_up�s<���z�z�z��>�*�*��
�
�a��
��Z�Z��
�
�+�A�.��
rc��UO]*[UO26Xc[Q2gU9O]*
tmUOUO*]*UmP!)zMove down in the frame stack.zNewest frame)r_�lenr^rr=rws&r�set_down�Bdb.set_down�sK���:�:��>�S����_�,��>�*�*��
�
�a��
��Z�Z��
�
�+�A�.��
r)r9r=r_r^)FNN)r
rrr
rr;rQr]rgrkrnrtrxr|r�__classdictcell__�
__classcell__�r@�
__classdict__s@@rr7r7ds:����.�9��(&�
�
�� �
/�/�/rr7c�``�\sQs]�snQsQU1QkksQsU1QksQsQs	Qs
QsQ	sQ
s
QsQsQ
sQsQsQsQsQsQsQQksQsQsQsUsU9s!)�Tracerz$A tracer for testing the bdb module.c�:�[RU_UQ5VmV0mUd
QU*LPUmUO2P!)��skipzDry-run results for %s:)r:�__init__�
expect_set�dry_run�header�	init_test)r<r�r�r��	test_caser@s&&&&&�rr��Tracer.__init__�sA���
���d��#�$���� �,�1�9�<�26�	
�����rc���PUm]UmPUm[[	UO
]P]22Um[[	UO
]P]22UmP!r)�
cur_except�
expect_set_no�breakpoint_hits�listrr��
expected_list�set_listrws&rr��Tracer.init_test�sP��������#���!�&����!�T�1�"E�F����V�D�O�O�Q��a�@�A��
rc��:�UOd
UOgUQ6Xc[RU_	VU2oU![RU_	VU2![coXPmSOtPo=!Po=hh9h)N�	exception)r�r:r;r)r<r=r>r?rX�er@s&&&&  �rr;�Tracer.trace_dispatch�ss���
�?�?�&��/�/�!��K��
+��g�,�U�3�?���
�
�7�)�%��<�<��	 �
+�"#���*�*�*��
+�s#�A�	A.�A.�A)�#A.�)A.c�~�UOU2%fP!UOQV2UO2P!)N�call)�	stop_here�
process_event�next_set_method)r<r=�
argument_lists&&&r�	user_call�Tracer.user_call�s2���~�~�e�$�$�����6�5�8����rc�J�UOQU2UO%cWUO%cE[2O	Q2oUOQ2FDo[
QU*2J	UO2PUmUO2P!)r-r"z  )	r�r�r�r5�strip�split�print�delete_temporariesr�)r<r=r2r-s&&  r�	user_line�Tracer.user_line�sx�����6�5�)��<�<�<�D�0�0�0�#�%�+�+�D�1�D��
�
�4�(���d�T�k�"�)����!�#������rc�L�UOQV2UO2P!��return�r�r�)r<r=�return_values&&&r�user_return�Tracer.user_return�s�����8�U�9����rc�X�V mUOQU2UO2P!)r�)�exc_infor�r�)r<r=r�s&&&r�user_exception�Tracer.user_exception�s#�� �
����;��.����rc�L�UOQU2UO2P!)�opcoder�)r<r=s&&r�user_opcode�Tracer.user_opcode�s�����8�U�+����rc�2�UO,oV"1UmP!r)r9r�)r<r?r0s&& r�do_clear�Tracer.do_clear�s���>�>�"�� '�1��rc��UO%c/UO]*FDoUOU2J	P!P!��)r��clear_bpbynumber)r<�ns& rr��Tracer.delete_temporaries�s9�������)�)�!�,�,���%�%�a�(�-� rc��U9O]*
tmUOO]2UmUOO]2UmP![c[QSO*2gh9h)r�z-expect_set list exhausted, cannot pop item %d)r�r��pop�expect�
IndexErrorrr��	set_tuplerws&r�pop_next�Tracer.pop_next�sw�����a���	$��,�,�0�0��3�D�K�
���*�*�1�-����	�	$�%�?��"�"�#�$�
$�	$�s� A�	B�(Bc
��PoUQ6XcUO]*oUOV$2UOd)UO%fUO,oU,1UmVmUO2UO%cUOUO2P!UO%c5UOUO]*UQ2UO2UQ	7cUO]2P![UO2]6�Cc�UQ6XCcUO]*vqg[UO22oUO%f#UO!QUO"*2UOV�O]*Q2SOST	t,tFDp�U	*MJ
	to	UO]*T	t,tFDo	UO%U	2O&MJ 	to	Q2UO[U2UO]*Q2P!UQ6Xcg[)UO]*UO]*2%f1UO!QUO"UO1*2P!P!P!P!tto	htto	h)
Nr�zWrong event typer-z(No breakpoints hit at expect_set item %dzBreakpoint numbers do not matchzWrong breakpoint hit countzWrong temporary breakpointsz/Wrong exception at expect_set item %d, got '%s')r�r�)r�r]r9r�r>r�r��print_stater�r��check_equal�check_lno_name�check_expect_max_sizer{�sorted�keys�raise_not_expectedr�rdr'rE)
r<r>r=�args�tbr0�bps�temporaries�bpnumsr�s
&&&*      rr��Tracer.process_event�sB�����K�����q�!�B����u�!��>�>�%�d�.B�.B�.B��~�~�&�G�$+�R�=�D� ��
��
�
���<�<�<����T�[�[�)���;�;�;����T�[�[��^�U�4F�G����!��&�&��&�&�q�)�
����
��
!����#'�;�;�q�>� ������
�+���+�+�+��+�+�B��*�*�+�,�� � ��)=�)=�a�)@�5�7�� � �&�!9�&�Q�a�&�&�&�!9�!�1�1�!�4�6�4���(�(��+�0�0�4�6�0�2�� � ���!4�d�6J�6J�1�6M�1�3��+�%�!�$�-�-��"2�D�K�K��N�C�C��+�+�I��+�+�T�]�]�;�<�=�D�&�#"��":��6s�J7�)&J<
c�`�V6XcP!UOQV0OU1*2P!)Nz"%s at expect_set item %d, got '%s')r�r�)r<�expected�result�msgs&&&&rr��Tracer.check_equal1s1�������� D�!$�&8�&8�&� A�!B�	Crc�>�[UO2oU]6�c5UO2oUOUO]*UQ2U]6�cEUOUO]*UOO
OQ2P!P!)z+Check the line number and function co_name.zWrong line numberzWrong function name)r{r��lno_abs2relr�r=�f_coderP)r<�srSs&  rr��Tracer.check_lno_name7sz���������q�5��%�%�'�F����T�[�[��^�V�5H�I��q�5����T�[�[��^�T�Z�Z�->�->�-F�-F�0E�
G�rc��[UO2U6�c([QUO8QUO802gP!)zInvalid size of the z expect tuple: )r{r�rr>)r<�sizes&&rr��Tracer.check_expect_max_sizeAs7���t�{�{��d�"� �"&�*�*�d�k�k�";�<�
<�#rc��UOUOOO2oUOOoVO[
26Xc.V OOO*
]*!S!r�)�canonicr=r�rN�f_linenorGrO�r<rrrSs&  rr��Tracer.lno_abs2relFsh�����T�Z�Z�.�.�:�:�;�����$�$�����X�.�.��*�*�+�+�:�:�:�Q�>�	<�4:�	<rc���U%cXUOU2UO[26Xc/UOOOU*]*
!S!r�)r�rGr=r�rOr�s&&&r�lno_rel2abs�Tracer.lno_rel2absLsJ���4�<�<��.�$�,�,�x�2H�H��
�
�!�!�0�0�6�9�A�=�	��	rc���UO2oUOOOoQUOV1*oUO
%c�QoUO
]*FD;oUQ6wc
UQ*
oVE8QUO
U2O80*
oJ=	UQ*
oQU*Q*[UO
]*2*Q*oUQU**
oL<UOQ6Xc,UQUO]*O**
oUQ*
oUO] 2[UO2*Q	*!)
z('%s', %d, '%s'�{z, z: �}�(�)r�z), �,)
r�r=r�rPr>r�rdr'rFr�r
�ljustr�)r<rSrP�stater�r�s&     r�	get_state�Tracer.get_stateQs&���!�!�#���*�*�#�#�+�+��!�T�Z�Z��$A�A�������C��)�)�!�,�,���#�:��4�K�C��1�d�&9�&9�!�&<�&A�&A�B�B��-�
�3�J�C���)�d�"�S��)=�)=�a�)@�%A�A�C�G�C��T�C�Z��E�
�Z�Z�;�
&��T�D�M�M�!�,�5�5�5�5�E�
�����{�{�2���T�^�^�!4�4�s�:�:rc��Ud'UO]6Xc[2[U2[QUOUO21*2P!)Nz%d: %s)r�r�r�)r<r�s&&rr��Tracer.print_statecs@����$�"4�"4��"9��G��&�M�
�h�$�,�,�d�n�n�.>�?�?�@rc��UQ*
oUQ[UO2**
oUQUO2**
o[U2g)r"z  Expected: %s
z  Got:      )rFr�r�r�r<r�s&&rr��Tracer.raise_not_expectedisE���t����!�C����$4�4�4���~���� 0�0�0��!�#�&�&rc���UO]*o[UO2]6XcUO]*LPo[UQU*2oUQ7c
U2P!UQ7cUUO2P!UQ6XcWPoU%c8UO	UOO
OU]*2oUUOU2P!U%cUQ7fUQ7c�UQ7c2UuqToUO	VT2oVT,oUOU2UULUQ	7c	UULUQ7cU2PUmUO2UO%cUO2L3UO%cUO2UO]2UO2P![!QUO*2g)
r\�set_�untilz"%s" is an invalid set_tuple)�step�	stepinstr�continue�quit)�nextr�)�break�clearr(�enable�disable)�up�down)rr)r(rr)r�r{�getattrr=r�r�rN�extendr>r�r�r�r�r�r�r�r)r<�set_typer��
set_methodrSrr�remains&      rr��Tracer.next_set_methodos����>�>�!�$��$'����$7�1�$<�t�~�~�a� �$���T�6�H�#4�5�
��@�@��L��
�+�
+��t�z�z�"��
��
 ��F���)�)�$�*�*�*;�*;�*G�*G�*.�q�'�3���t�z�z�6�*��
�X�"/�/�3;�~�3M��-�-�)-�&����)�)�%�8��������F�#��D�!��<�<��D�!��^�+����D�J��M�M�O��|�|�|�� � �"��;�;�;��'�'�)��*�*�1�-�� � �"� �!?�!%���"0�1�
1r)r�r�r�r>r�r�r�r�r�r�r�r�)NFNr)r
rrr
rr�r�r;r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr~rr�s@@rr�r��s{����.��B�=�$����
�2�
)�
.�0=�dC�G�<�
<��
;�$A�'�01�01rr�c�@`�\sQsQsnQsQQksQsQQksQsUs	P!)	�	TracerRun�zAProvide a context for running a Tracer instance with a test case.c��VmUOUm[UOUUOUO	2Q5UmPUmP!))r�r�r�)r�r�r�r��id�tracer�_original_tracer)r<r�r�s&&&rr��TracerRun.__init__�sB��"�� �(�(����Y�1�1��%)�\�\�Y�\�\�^�M��� $��rc�d�[2[O2UmUO!r)r�sys�gettracerrrws&r�	__enter__�TracerRun.__enter__�s ���� #�������{�{�rc��[2[OUO2PoUOO
%cTUQ*
oUQUOO**
oU[UOO
2*
oUd�[[U2%c�[U[2%cyUO%cgUO]*oU%cUQU**
oUO%c[U2P	!UOO!U2U%c=UO%c[U2P!UOO!U2P!P!)r z+All paired tuples have not been processed, zthe last one was number %d
r")rr�settracerrr�r��repr�
issubclassrrE�
BaseExceptionr�r�r�r��fail)r<�type_�value�	traceback�	not_empty�err_msgs&&&&  r�__exit__�TracerRun.__exit__�s
�������T�*�*�+��	��;�;�����F�F�I��8��+�+�3�3�4�
5�I���d�k�k�2�2�3�3�I����,?��!G�!G��%��/�/�E�J�J�J��*�*�Q�-����t�i�/�/�G��<�<�<��'�N���N�N�'�'��0���|�|�|��i� ����#�#�I�.�	r)rr�r�rr)NNN)
r
rrr
rr�rr&rr~�r�s@rrr�s����K�%��/�/rrc	��QoQQ,oUOU2[2oP	UmQUm[	U[Q2[
U222Um[U29^tt^2[VRQ59^tt^2oUO[2PPP2PPP2P!)%fhK9h)%fhP!9h)a�Run a test and print the dry-run results.

'modules':  A dictionary mapping module names to their source code as a
            string. The dictionary MUST include one module named
            'test_module' with a main() function.
'set_list': A list of set_type tuples to be run on the module.

For example, running the following script outputs the following results:

*****************************   SCRIPT   ********************************

from test.test_bdb import run_test, break_in_func

code = '''
    def func():
        lno = 3

    def main():
        func()
        lno = 7
'''

set_list = [
            break_in_func('func', 'test_module.py'),
            ('continue', ),
            ('step', ),
            ('step', ),
            ('step', ),
            ('quit', ),
        ]

modules = { 'test_module': code }
run_test(modules, set_list)

****************************   results   ********************************

1: ('line', 2, 'tfunc_import'),    ('next',),
2: ('line', 3, 'tfunc_import'),    ('step',),
3: ('call', 5, 'main'),            ('break', ('test_module.py', None, False, None, 'func')),
4: ('None', 5, 'main'),            ('continue',),
5: ('line', 3, 'func', ({1: 1}, [])), ('step',),
  BpNum Temp Enb Hits Ignore Where
  1     no   yes 1    0      at test_module.py:2
6: ('return', 3, 'func'),          ('step',),
7: ('line', 7, 'main'),            ('step',),
8: ('return', 7, 'main'),          ('quit',),

*************************************************************************

c3�x �[U2o[U2oUw�Uw�J#[cP!h9h3hr�)r�
StopIteration)�a�b�x�ys&&  r�gen�run_test.<locals>.gens:���	����G����G��������	��	�s�:�#(�	7�7�:�7�:c��P!rr	r	rr�<lambda>�run_test.<locals>.<lambda>s��trr��r�r�r	)r	�BaseTestCaser�rr�r�iterr��create_modulesr�runcall�tfunc_import)�modulesr�r�r0�sl�testrs&&&    r�run_testr?�s���f��j�	!�B��I�I�h���>�D��D�L��D�G��3�v�b�z�4��8�4�5�D�O�	��	 �	 �
�t�
'�
'�6��N�N�<�(�(�
!�	 �
'�
'��
!�	 �	 �s0�/B?�B,	�B?�,B<
�5B<
�7B?�?C	�C	c#�. �[O29^tt^2[OO	[
O22SFDloUQ*o[UQQQ59^tt^2oUO[OV*22PPP2[OU2Jn	[O2Pw�SFDo[O U2J	[OO#2PPP2P!)%fhK�9hSFDo[O S2J	[OO#2h9h)%fhP!9h3h)�.py�wzutf-8)�encoding)r�temp_cwdrr*�appendr)�getcwd�open�write�textwrap�dedent�	linecache�
checkcacherI�invalidate_cachesr�forgetr�)r<�mrrr`s&   rr9r9s����	�	�	�	�	�������	�	��$�	����E�	���%��w�7�7�1��G�G�H�O�O�G�J�7�8�8��$�$�U�+�	�

�'�'�)�����$�$�Q�'���H�H�L�L�N�
�	�
8�7�����$�$�Q�'���H�H�L�L�N��
�	�	�sY�F�3F�%D>�:,D+
�&<D>�">F�!
F�+D;�4D;�6D>�>AE>�>F�F	�
F	�	Fc��QUPV#U11!)rr	)rCrrr$r.s&&&&r�
break_in_funcrQ+s���U�D�)�8�<�<�<r�test_module_for_bdbrAc�0�]PHoUO2P!r[)rR�main)rRs rr;r;0s������rc�@�]o[2[2]o]o]oP!��)�tfunc_first�tfunc_second��lnos r�
tfunc_mainr\4s ��
�C��M��N�
�C�
�C�
�Crc��]o]o]oP!rVr	rZs rrXrX<s��
�C�
�C�
�Crc��]oP!rVr	rZs rrYrYAs��
�Crc�4`�\sQsQsnQs\sQQksQsUsP!)r7�DzBase class for all tests.c�(�UOU2Pgr)�failureExceptionr�s&&rr �BaseTestCase.failIs���#�#�C�(�d�2rr	r)	r
rrr
rr�r rr~r(s@rr7r7Ds����#��G�3�3rr7c�`�\sQsQsnQsQsQsQsQsQs	Qs
Q	sQ
sQs
QsQ
sQs\\O&2Q2sQsQsQsQsUsP!)�
StateTestCase�Nz;Test the step, next, return, until and quit 'set_' methods.c��,QNUm[U29^tt^2oUO[2PPP2P!)%fhP!9h)r-)�r-rWr\r6�r-�r\r6�r�r�rXr6�r-rWrX�r�r�rr:r\�r<rs& r�	test_step�StateTestCase.test_stepQ�0��
����t�_�_���N�N�:�&��_�_�_���>�A	�A	c�Z�QFD{oUOUQ59^tt^2QQQQQ	Q[]11Q
QQ]Q]]-,11U1QQ
,Um[U29^tt^2oUO	[
2PPP2PPP2J}	P!)%fhK9h)%fhJ�9h)r��r
r-rXr)r�rrhr6rirk)�Noner�rX�r��r-�rXrm)�subTestrGr�rr:r\)r<r
rs&  r� test_step_next_on_last_statement�.StateTestCase.test_step_next_on_last_statement[s���(�H����x��0�0�-�Z�-�Z�.�g��RS�}�=U�.�^��Q�
��1��r�{�;�h�\�.�Z�
#����t�_�_���N�N�:�.�%�1�0�)�%�_��1�0�0�s/�8B	�B
�0B	�B�B�B	�B*
�"B*
c��,QNUm[U29^tt^2oUO[2PPP2P!)%fhP!9h)r-)rh)r�)r�rWr\r5rirmrnros& r�test_stepinstr�StateTestCase.test_stepinstris0��
���
�t�_�_���N�N�:�&��_�_�_�rsc��,QNUm[U29^tt^2oUO[2PPP2P!)%fhP!9h)r-)
rhr6rir5�r-ryr\r6)r�r�rYr6)r-rWrYrmrnros& r�	test_next�StateTestCase.test_nextr�0��
����t�_�_���N�N�:�&��_�_�_�rsc	��Qo[U-o[U29^tt^2,QNUm[U29^tt^2oUO	[
2PPP2PPP2P!)%fhK9h)%fhP!9h)�9
            def main():
                lno = 3
        )�r-rWr;r5�r-rjr;rm)�TEST_MODULEr9r�rr:r;�r<rWr<rs&   r�test_next_over_import�#StateTestCase.test_next_over_import}sc���� ��'��
�G�
$�
$��D�O��4���F����|�,�!�%�
$�
!���%�
$�
$�s.�A7�A$	�A7�$A4
�-A4
�/A7�7B	�B	c��,QNUm[U29^tt^2oUO[2PPP2P!)%fhP!9h)r-)rhr6rir6rkr5rlrmrnros& r�test_next_on_plain_statement�*StateTestCase.test_next_on_plain_statement�s0��
����t�_�_���N�N�:�&��_�_�_�rsc��,QNUm[U29^tt^2oUO[2PPP2P!)%fhP!9h)r-)
rhr6rir6rk�r�rvrjr\r5r�rmrnros& r�test_next_in_caller_frame�'StateTestCase.test_next_in_caller_frame�s0��
����t�_�_���N�N�:�&��_�_�_�rsc��,QNUm[U29^tt^2oUO[2PPP2P!)%fhP!9h)r-)rhr6rir6rkr6rlr��r�ryrXr6r�rmrnros& r�test_return�StateTestCase.test_return�s0��
����t�_�_���N�N�:�&��_�_�_�rsc��,QNUm[U29^tt^2oUO[2PPP2P!)%fhP!9h)r-)
rhr6rir6rkr�r�r�)r��r\rmrnros& r�test_return_in_caller_frame�)StateTestCase.test_return_in_caller_frame�r�rsc��,QNUm[U29^tt^2oUO[2PPP2P!)%fhP!9h)r-)
rhr6rir6rkr6rl)r�)ryrxrmrnros& r�
test_until�StateTestCase.test_until�r�rsc	���Q[Q2QQQ]Q]]-,11QQQ,Um[U29^tt^2oUO[2PPP2P!)%fhP!9h)r-rXrh)rvrWr\rw)r�)i'r�rm)rQr�rr:r\ros& r�test_until_with_too_large_count�-StateTestCase.test_until_with_too_large_count�s[��%�]�=�5Q�%�^�
�Q�
��1��r�{�3�5H�(�Z�	
����t�_�_���N�N�:�&��_�_�_�s�A�A&	�A&	c��,QNUm[U29^tt^2oUO[2PPP2P!)%fhP!9h)r-)
rhr6rir6rkr�r�)r�)�)r-r�r\rmrnros& r�test_until_in_caller_frame�(StateTestCase.test_until_in_caller_frame�r�rsc	�z�Q[O2[OQ$Qo[U-o[U29^tt^2,QNUmQQQ[1o[VQ59^tt^2oUO
[2PPP2PPP2P!)%fhK9h)%fhP!9h)c3�x�SF �D+oUOOQ2%fJ&Uw�	J-	P!3h)�_frozen_importlib)r�
startswith)�.0�items& r�	<genexpr>�*StateTestCase.test_skip.<locals>.<genexpr>�s+��%���%�����)�)�*=�>�
�D�%�s�#:�::NNNr�z
importlib*�	zipimportzencodings.*r�)r�r6r�rm)r�	meta_pathr�r9r�rr:r;)r<rWr<r�rs&    r�	test_skip�StateTestCase.test_skip�s���
��
�
�
��
�
�a���� ��'��
�G�
$�
$��D�O�!�+�}�k�J�D��4�+�+�v����|�,�,�
%�
$�,�+��
%�
$�
$�s0�(B)�.B	�B)�B&
�B&
�!B)�)B:	�2B:	c�d�[Q,Q5oUOUOP2P
2P!)z	anything*r�)r7�assertIs�is_skipped_module)r<�bdbs& r�test_skip_with_no_name_module�+StateTestCase.test_skip_with_no_name_module�s)����}�%���
�
�c�+�+�D�1�5�9rc���QQ,Um[U29^tt^2oUO[UO[
2PPP2P!)%fhP!9h)r-rh)r)r�r�assertRaisesrr:r\ros& r�	test_down�StateTestCase.test_down�sA��
&�z�
����t�_�_�����h����
�C��_�_�_���&A�A	�A	c��,QNUm[U29^tt^2oUO[2PPP2P!)%fhP!9h)r-)rhr6rir6rkr�r�rmrnros& r�test_up�StateTestCase.test_uprrrs�r�)r
rrr
rrpr{r~r�r�r�r�r�r�r�r�r�rrr�r�r�r�r�rr~r(s@rrereNsv����E�'�/�'�	'�-�
'�'�
'�	'�	'�'�	'���
�
��-��-�2:�D�'�'rrec�h`�\sQsQsnQsQsQsQsQsQs	Qs
Q	sQ
sQs
QsQ
sQsUsP!)�BreakpointTestCase�zTest the breakpoint set method.c���QQ,Um[U29^tt^2oUO[UO[
2PPP2P!)%fhP!9h)r-r�)r)z/non/existent/module.pyr�)r�rr�rr:r;ros& r�test_bp_on_non_existent_module�1BreakpointTestCase.test_bp_on_non_existent_modules@��'�)R�
����t�_�_�����h�����E��_�_�_�r�c	�F�Qo[U-o[U29^tt^2QQ[]11,Um[	U29^tt^2oUO[UO[2PPP2PPP2P!)%fhK9h)%fhP!9h)r�rr�)	r�r9�TEST_MODULE_FNAMEr�rr�rr:r;r�s&   r�test_bp_after_last_statement�/BreakpointTestCase.test_bp_after_last_statements}���� ��'��
�G�
$�
$�+�g�8I�1�7M�-N��D�O��4���F��!�!�(�F�N�N�L�I�!�	%�
$�!���	%�
$�
$�s/�%B�&A<	�*B�<B
�B
�B�B 	�B 	c��Qo[U-o[U29^tt^2Q[Q[P	2Q[Q[P	2QQQ]Q]]-],11QQ]Q]]-],11Q,
Um[U29^tt^2oUO
[2PPP2PPP2P!)%fhK9h)%fhP!9h)��
            def func():
                lno = 3

            def main():
                for i in range(2):
                    func()
        r-rVr��rvrWr;rwrm�r�r9rQr�r�rr:r;r�s&   r�test_temporary_bp�$BreakpointTestCase.test_temporary_bp%s����� ��'��
�G�
$�
$�+�!�&�*;�T�B�+�!�&�*;�T�B�+�>���F�a��U�Q�C�L�1�>���F�a��U�Q�C�L�1�:��D�O��4���F����|�,�!�%�
$�!���%�
$�
$�s0�AB/�4B	�
B/�B,
�%B,
�'B/�/C	�8C	c��Qo[U-o[U29^tt^2Q[Q[2Q[Q[P	2QQQQQ]Q]]-,11QQQ	QQQ]Q]]-],11Q
QQQ]Q]]-,11Q,Um[U29^tt^2oUO
[2PPP2PPP2P!)%fhK9h)%fhP!9h)��
            def func():
                lno = 3

            def main():
                for i in range(3):
                    func()
        r-rVr�r�)rrVrw)rrV�rvrjrV�rr��rr�rmr�r�s&   r�test_disabled_temporary_bp�-BreakpointTestCase.test_disabled_temporary_bp<s����� ��'��
�G�
$�
$�+�!�&�*;�<�+�!�&�*;�T�B�+�3E�+�>���F�a��U�B�K�0�3D�#�3E�#�>���F�a��U�Q�C�L�1�3D�#�>���F�a��U�B�K�0�:�
�D�O��4���F����|�,�!�%�
$�!���%�
$�
$�s0�A%B?�B,	�B?�,B<
�5B<
�7B?�?C	�C	c�N�Qo[U-o[U29^tt^2Q[Q[P
Q2QQQ]Q]]-,11Q,Um[U29^tt^2oUO
[2PPP2PPP2P!)%fhK9h)%fhP!9h)z�
            def func(a):
                lno = 3

            def main():
                for i in range(3):
                    func(i)
        r-rVza == 2r�r�rwrmr�r�s&   r�test_bp_condition�$BreakpointTestCase.test_bp_conditionXs����� ��'��
�G�
$�
$�+�!�&�*;�U�H�M�+�>���F�a��U�B�K�0�:�	�D�O��4���F����|�,�!�%�
$�!���%�
$�
$��/�9B�B	�.B�B
�	B
�B�B$	�B$	c�N�Qo[U-o[U29^tt^2Q[Q[P
Q2QQQ]Q]]-,11Q,Um[U29^tt^2oUO
[2PPP2PPP2P!)%fhK9h)%fhP!9h)zk
            def func(a):
                lno = 3

            def main():
                func(0)
        r-rVz1 / 0r�r�rwrmr�r�s&   r�)test_bp_exception_on_condition_evaluation�<BreakpointTestCase.test_bp_exception_on_condition_evaluationls����� ��'��
�G�
$�
$�+�!�&�*;�U�G�L�+�>���F�a��U�B�K�0�:�	�D�O��4���F����|�,�!�%�
$�!���%�
$�
$�r�c
�N�Qo[U-o[U29^tt^2Q[Q[2QQQQQ]Q]]-,11Q,Um[U29^tt^2oUO
[2PPP2PPP2P!)%fhK9h)%fhP!9h)r�r-rVr�r��r(r�rwrmr�r�s&   r�test_bp_ignore_count�'BreakpointTestCase.test_bp_ignore_counts����� ��'��
�G�
$�
$�+�!�&�*;�<�+�2C�+�.���F�a��U�B�K�0�*��D�O��4���F����|�,�!�%�
$�!���%�
$�
$�r�c��Qo[U-o[U29^tt^2Q[Q[2Q[Q[2QQQQQQQ]Q]]-,11QQ	QQ]Q]]-,11QQ]Q]]-,11Q
,Um[U29^tt^2oUO
[2PPP2PPP2P!)%fhK9h)%fhP!9h)r�r-rVr�r�r�r�rwr�r�rmr�r�s&   r� test_ignore_count_on_disabled_bp�3BreakpointTestCase.test_ignore_count_on_disabled_bp�s����� ��'��
�G�
$�
$�+�!�&�*;�<�+�!�&�*;�<�+�2C�+�2D�+�.���F�a��U�B�K�0�2C�#�.���F�a��U�B�K�0�.���F�a��U�B�K�0�*��D�O��4���F����|�,�!�%�
$�!���%�
$�
$�s0�A!B;�B(	�B;�(B8
�1B8
�3B;�;C	�C	c��Qo[U-o[U29^tt^2QQ[]11QQ[]11QQ[]11QQQ]Q]]-,11QQ]Q]]-,11Q[]11QQQ]Q]]-,11Q	,Um[	U29^tt^2oUO[2PPP2PPP2P!)%fhK9h)%fhP!9h)
z�
            def func():
                lno = 3
                lno = 4

            def main():
                for i in range(3):
                    func()
        r-rrVrr�r�rw)rvryrVrm)r�r9r�r�rr:r;r�s&   r�test_clear_two_bp_on_same_line�1BreakpointTestCase.test_clear_two_bp_on_same_line�s����� ��'��
�G�
$�
$�+�7�=N�PQ�<R�2S�+�7�=N�PQ�<R�2S�+�7�=N�PQ�<R�2S�+�.���F�a��U�B�K�0�.���F�a��U�B�K�0�7�=N�PQ�<R�2S�#�.���F�a��U�B�K�0�*�	�D�O��4���F����|�,�!�%�
$�!���%�
$�
$�s0�A#B=�B*	�B=�*B:
�3B:
�5B=�=C	�C	c���QQ[]11,Um[U29^tt^2oUO[UO
[2PPP2P!)%fhP!9h)r-rr�)rGr�rr�rr:r;ros& r�test_clear_at_no_bp�&BreakpointTestCase.test_clear_at_no_bp�sH��'�'�H�a�=�)A�
����t�_�_�����h�����E��_�_�_�s�&A�A'	�A'	c��[2[2oUO[2oUO	[]2UOUO
2U],-2[2oUO	[]2UO	[]2UO	[]2UOUO
2U],-2UOUO
2U,QN-2UO[]2UOUO
2U],-2UOUO
2U,QN-2[2oUOUO
2U],-2UOUO
2U,QN-2UOUO
2U,QN-2UO[]2UOUO
2U],-2UOUO
2U]],-2UOUO
2U,QN-2[2oUO	[]2UOUO
2U],-2UOUO
2U]],-2UOUO
2U,QN-2UOUO
2U,QN-2[2[2oUO	[]2UOUO
2U],-2UOUO
2U]],-2UOUO
2U,QN-2UOUO
2U,QN-2UOUO
2U],-2P!)r�)r�rWrjry)rWrjry)rjry�)rr7r�rGrQ�assertEqual�get_all_breaksrq)r<�db1rr�db2�db3�db4�db5s&      r�(test_load_bps_from_previous_Bdb_instance�;BreakpointTestCase.test_load_bps_from_previous_Bdb_instance�s�����e�����H�%���
�
�h��"�����+�+�-���s�|�<��e���
�
�h��"��
�
�h��"��
�
�h��"�����+�+�-���s�|�<�����+�+�-��|�/D�E�����!�$�����+�+�-���s�|�<�����+�+�-��y�/A�B��e������+�+�-���s�|�<�����+�+�-��y�/A�B�����+�+�-��y�/A�B�����!�$�����+�+�-���s�|�<�����+�+�-���1�v��?�����+�+�-��y�/A�B��e���
�
�h��"�����+�+�-���s�|�<�����+�+�-���1�v��?�����+�+�-��y�/A�B�����+�+�-��y�/A�B����e���
�
�h��"�����+�+�-���s�|�<�����+�+�-���1�v��?�����+�+�-��y�/A�B�����+�+�-��y�/A�B�����+�+�-���s�|�<rr�)r
rrr
rr�r�r�r�r�r�r�r�r�r�r�rr~r(s@rr�r�sG����)�F�J�-�.-�8-�(-�&-�*-�6-�2F�(=�(=rr�c�2`�\sQsQsnQsQsQsQsUsP!)�RunTestCase�z Test run, runeval and set_trace.c	���Qo,QNUm[U29^tt^2oUO[[O
U2QQ22PPP2P!)%fhP!9h)�
            lno = 2
        �<string>�exec)�r-rW�<module>r6�r�rWrrm�r�r�run�compilerIrJ�r<rWrs&  r�
test_run_step�RunTestCase.test_run_step�sI����
����t�_�_���J�J�w�x���t�4�j�&�I�J��_�_�_���1A�A,	�$A,	c	� �Qo[U-o[U29^tt^2,QNUm]PHoQU-o[	U29^tt^2oUOQVD2PPP2PPP2P!)%fhK9h)%fhP!9h)r�rRztest_module_for_bdb.main())
)r-r�rr6)r�rWrTr6)r-rjrTr6)r�rjrTr6)r�r�rrm)r�r9r�rRr�runeval)r<rWr<rR�nsrs&     r�test_runeval_step�RunTestCase.test_runeval_step	st���� ��'��
�G�
$�
$��D�O�
'�'�)<�=�B��4���F����;�R�D�!�%�
$�!���%�
$�
$�s/�%A<�A)	�A<�)A9
�2A9
�4A<�<B
	�B
	r�)	r
rrr
rrrrr~r(s@rr�r��s����*�
K�E�Err�c�J`�\sQsQsnQsQsQsQsQsQs	Qs
Q	sUsP!)
�IssuesTestCaseizTest fixed bdb issues.c�R�QoQo[UQU-o[U29^tt^2Q[QQ2QQQ]Q]]-,11Q	Q
Q	QQ,
Um[	U29^tt^2oUO[2PPP2PPP2P!)%fhK9h)%fhP!9h)
z�
            from test_module_for_bdb_2 import func
            def main():
                func()
                lno = 5
        z9
            def func():
                lno = 3
        �test_module_for_bdb_2r-rVztest_module_for_bdb_2.pyr�r�rwr6)r�rjrV)r-r�rTrm)r�r9rQr�rr:r;)r<�code_1�code_2r<rs&    r�+test_step_at_return_with_no_trace_in_caller�:IssuesTestCase.test_step_at_return_with_no_trace_in_caller s�������

��#�V�
���G�
$�
$�+�!�&�*D�E�+�.���F�a��U�B�K�0�*�%�*�#�*�
�D�O��4���F����|�,�!�%�
$�!���%�
$�
$�s/�7B�B	�0B�B
�B
�
B�B&	�B&	c�f�Qo[U-oQFD�oUOUQ59^tt^2[U29^tt^2Q[Q[2Q	Q
Q]Q]]-,11U1,UmUQ6Xc)UO
O
Q]
Q[1QQQ
,2LUO
O
QQ
,2[U29^tt^2oUO[2PPP2PPP2PPP2J�	P!)%fhK&9h)%fhK19h)%fhCJ!9h)z�
            def test_gen():
                yield 0
                lno = 4
                return 123

            def main():
                it = test_gen()
                next(it)
                next(it)
                lno = 11
        r�rur-�test_genr�rT)rr�r�r�r�rwr6)r��
rTrm�r-ryr)r�rzr9rQr�r�r	r+rr:r;)r<rWr<r
rs&    r�#test_next_until_return_in_generator�2IssuesTestCase.test_next_until_return_in_generator>s��
�� ��'��3�H����x��0�0�#�G�,�,�3�)�*�6G�H�3�n���J�!�A����<�x�l�	'�D�O� �8�+����.�.�)�2�v�}�E�y�3�z������.�.�4�j�B��#�4���F����|�4�)�%-�1�0�4�()���%-�,��1�0�0�sT�D	�+D
�,AD
�C8�D
�"D	�8D�D�D
�D�D�D	�D0
�'D0
c�n�Qo[U-o[U29^tt^2Q[Q[2QQQ]Q]]-,11QQ	QQ
QQQQ]	Q[1QQ
Q,Um[
U29^tt^2oUO[2PPP2PPP2P!)%fhK9h)%fhP!9h)z�
            def test_gen():
                yield 0
                lno = 4
                yield 1
                return 123

            def main():
                for i in test_gen():
                    lno = 10
                lno = 11
        r-rr�rTr�r�rwr5r)r-r�r)r-r�rr6)r-�rTrm�	r�r9rQr�r+r�rr:r;r�s&   r�'test_next_command_in_generator_for_loop�6IssuesTestCase.test_next_command_in_generator_for_loopgs����� ��'��
�G�
$�
$�+�!�*�.?�@�+����J�!�A����4��'��'��'���a���7��$���D�O��4���F����|�,�!�%�
$�!���%�
$�
$�s0�A	B#�(B	�>B#�B 
�B 
�B#�#B4	�,B4	c�f�Qo[U-o[U29^tt^2Q[Q[2QQQ]Q]]-,11QQ	QQ]Q[1Q
QQ,Um[
U29^tt^2oUO[2PPP2PPP2P!)%fhK9h)%fhP!9h)
�4
            def test_subgen():
                yield 0
                return 123

            def test_gen():
                x = yield from test_subgen()
                return 456

            def main():
                for i in test_gen():
                    lno = 12
                lno = 13
        r-rr�rTr�r�rwr5)r-�rr6�r-�
rTrmrr�s&   r�/test_next_command_in_generator_with_subiterator�>IssuesTestCase.test_next_command_in_generator_with_subiterator�s���
�� ��'��
�G�
$�
$�+�!�*�.?�@�+�.���J�!�A����4�*�'�*��b�&�-�8�*�$�*�	�D�O��4���F����|�,�!�%�
$�!���%�
$�
$�s0�AB�$B	�:B�B
�B
�B�B0	�(B0	c�v�Qo[U-o[U29^tt^2Q[Q[2QQQ]Q]]-,11Q	Q]Q[1Q	Q]Q[1Q
QQ,Um[
U29^tt^2oUO[2PPP2PPP2P!)%fhK9h)%fhP!9h)
r"r-�test_subgenr�rrTr�r�rwr�r6r$rmrr�s&   r�1test_return_command_in_generator_with_subiterator�@IssuesTestCase.test_return_command_in_generator_with_subiterator�s���
�� ��'��
�G�
$�
$�+�!�-�1B�C�+�n���M�Q�q�E�2�;�7�l��a��]�;�l��b�&�-�8�j�$�j�	�D�O��4���F����|�,�!�%�
$�!���%�
$�
$�s0�A
B'�,B	�B'�B$
�B$
�B'�'B8	�0B8	c	���Qo,QNUm[U29^tt^2oUO[[O
U2QQ22PPP2P!)%fhP!9h)r�r�r�)r�r6rr5rrs&  r�test_next_to_botframe�$IssuesTestCase.test_next_to_botframe�sI����
����t�_�_���J�J�w�x���t�4�j�&�I�J��_�_�_�rr�)
r
rrr
rrrrr&r*r-rr~r(s@rrrs.���� �-�<'5�R-�>-�>-�>K�Krrc�(`�\sQsQsnQsQsUsP!)�TestRegressionsi�c��UOQ[2O[O2P122P!)zWarning: lineno is None)�assertInr7�format_stack_entryr�	_getframerws&r�!test_format_stack_entry_no_lineno�1TestRegressions.test_format_stack_entry_no_lineno�s-���
�
�/��e�.�.��
�
���/F�G�	Irr	)r
rrr
r5rr~r(s@rr0r0�s����I�Irr0�__main__r)0rr�rrr)�unittestrIrIrK�
contextlibr�	itertoolsrr�test.supportrrr�	Exceptionrrrrr�rr5r7r�rr?r9rGrQr�r�r;r\rXrY�TestCaser7rer�r�rr0r
rTr	rr�<module>r>sZ��0�d�
�	�����%�$�&�"�#�$�9�#�E�|�E�H�\�H�A�,�A���'��*>/�$�(�(�>/�@{1�S�{1�z-/�-/�^H)�T���� #+�e�$�=�$���%�'�����
�3�8�$�$�3�~'�L�~'�@i=��i=�X!E�,�!E�FrK�\�rK�jI�h�'�'�I��z���M�M�O�r

Youez - 2016 - github.com/yon3zu
LinuXploit