Sindbad~EG File Manager

Current Path : /proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/
Upload File :
Current File : //proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/test_trace.cpython-312.opt-1.pyc

�

'ΜgV���ddlZddlmZddlZddlmZmZddlmZm	Z	m
Z
ddlmZm
Z
ddlZddlZddlmZddlZddlmZddlmZd	�Zd
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d�Z"d�Z#Gd�de$�Z%Gd�dejL�Z'Gd�dejL�Z(Gd�dejL�Z)Gd�d ejL�Z*Gd!�d"ejL�Z+Gd#�d$ejL�Z,Gd%�d&ejL�Z-Gd'�d(ejL�Z.Gd)�d*ejL�Z/e0d+k(rejb�yy),�N)�dump)�captured_stdout�requires_resource)�TESTFN�rmtree�unlink��assert_python_ok�assert_python_failure)�FunctionType)�Trace)�testmodc�2�|jd�r|dd}|S)z8Given a .pyc filename converts it to the appropriate .pyz.pycN���)�endswith)�filenames �,/usr/local/lib/python3.12/test/test_trace.py�
fix_ext_pyrs ������ ��C�R�=���O�c��tjjtjjt��d}tt�|fS)z4The .py file and module name of this file (__file__)r)�os�path�splitext�basename�__file__r)�modnames r�my_file_and_modnamers:���g�g���r�w�w�/�/��9�:�1�=�G��h���(�(rc�.�|jjS�N)�__code__�co_firstlineno��funcs r�get_firstlinenor$"s���=�=�'�'�'rc��|}|}||z}|Sr�)�x�y�a�b�cs     r�traced_func_linearr,,s��	�A�	�A�	�A��A��Hrc�4�|}td�D]}||z
}�	|S�N���range)r'r(r+�is    r�traced_func_loopr32s#��	�A�
�1�X��	�Q�����Hrc�8�||ztjd�zS)N�)rr#)r'r(s  r�traced_func_importingr68s���q�5�7�<�<��?�"�"rc�$�t||�}||zSr�r,)r'r+s  r�traced_func_simple_callerr9;s���1�a� �A��q�5�Lrc�:�t|�}|t||�z
}|Sr)r9r6)r'�ks  r�traced_func_importing_callerr<?s#��!�!�$�A��	�q�!�	$�$�A��Hrc#�>K�d}t|�D]	}||z���y�wr.r0)�numr+r2s   r�traced_func_generatorr?Ds"����	�A�
�3�Z���!�e���s�c�2�d}td�D]}||z
}�	y)Nr�
)r?)r;r2s  r�traced_func_calling_generatorrBIs��	�A�
"�2�
&��	�Q���'rc��|dzS�N�r&)r>s r�traced_doublerrFNs����7�Nrc�
�||fSrr&)�args�kwargss  r�traced_capturerrJQs����<�rc�V�d}t|�D�cgc]
}t|���}}|Scc}w)NrA)r1rF)r;r2�mylists   r� traced_caller_list_comprehensionrMTs.��
�A�).�q��
2��A�n�Q���F�
2��M��3s�&c�B�d�}d�}||�d���}|�y)Nc��|Srr&��fs r�
decorator1z-traced_decorated_function.<locals>.decorator1Zs���rc��d�}|S)Nc��|Srr&rPs r�
decorator2zGtraced_decorated_function.<locals>.decorator_fabric.<locals>.decorator2]s���Hrr&�rUs r�decorator_fabricz3traced_decorated_function.<locals>.decorator_fabric\s
��	��rc��yrr&r&rrr#z'traced_decorated_function.<locals>.func`s��	
rr&)rRrWr#s   r�traced_decorated_functionrYYs0�������
���
��Frc�>�eZdZd�Zd�Zd�Zed��Zed��Z	y)�TracedClassc��||_yr�r))�selfr's  r�__init__zTracedClass.__init__hs	����rc� �|j|zSrr])r^r(s  r�inst_method_linearzTracedClass.inst_method_linearks���v�v��z�rc�B�|j|�}|t||�zSr)rar,)r^r'r+s   r�inst_method_callingzTracedClass.inst_method_callingns%���#�#�A�&���%�a��+�+�+rc��|dzSrDr&)�clsr(s  r�class_method_linearzTracedClass.class_method_linearr����1�u�rc��|dzSrDr&)r(s r�static_method_linearz TracedClass.static_method_linearvrgrN)
�__name__�
__module__�__qualname__r_rarc�classmethodrf�staticmethodrir&rrr[r[gs9����,��������rr[c�@�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zy
)�TestLineCountsz/White-box testing of line-counting, via runfuncc��|jtjtj��t	dddd��|_t
t�|_y)Nr5r��count�trace�
countfuncs�countcallers)	�
addCleanup�sys�settrace�gettracer
�tracerrr�my_py_filename�r^s r�setUpzTestLineCounts.setUp�s9��������c�l�l�n�5��!�1���K���(��2��rc�>�|jjtdd�}|j|d�i}t	t�}tdd�D]}d||j||zf<�|j|jj�j|�y)NrEr/�r5)	r{�runfuncr,�assertEqualr$r1r|�results�counts)r^�result�expected�firstlinenor2s     r�test_traced_func_linearz&TestLineCounts.test_traced_func_linear�s������$�$�%7��A�>�������#���%�&8�9���q�!��A�@A�H�d�)�)�;�!�+;�<�=��	
������,�,�.�5�5�x�@rc	�X�|jjtdd�tt�}|j|dzfd|j|dzfd|j|dzfd|j|dzfdi}|j|jj
�j|�y)NrE�r5�r/�)r{r�r3r$r|r�r�r��r^r�r�s   r�test_traced_func_loopz$TestLineCounts.test_traced_func_loop�s��������,�a��3�%�&6�7��
�
 �
 �+��/�2�A�
�
 �
 �+��/�2�A�
�
 �
 �+��/�2�A�
�
 �
 �+��/�2�A�	
��	
������,�,�.�5�5�x�@rc�^�|jjtdd�tt�}|j|dzfdttj�dfdttj�dfdi}|j|jj�j|�y)NrEr/r5r�)r{r�r6r$r|rrrr�r�r�r�s   r�test_traced_func_importingz)TestLineCounts.test_traced_func_importing�s��������1�1�a�8�%�&;�<��
�
 �
 �+��/�2�A�
��(�(�
)�1�-�q�
��(�(�
)�1�-�q�
��	
������,�,�.�5�5�x�@rc
��|jjt�tt�}tt�}|j
|dzfd|j
|dzfd|j
|dzfd|j
|dzfd|j
|dzfd|j
|dzfdi}|j
|jj�j|�y�Nr5rE�r�rA)	r{r�rBr$r?r|r�r�r�)r^�firstlineno_calling�firstlineno_genr�s    r�test_trace_func_generatorz(TestLineCounts.test_trace_func_generator�s��������9�:�-�.K�L��)�*?�@��
�
 �
 �"5��"9�:�A�
�
 �
 �"5��"9�:�B�
�
 �
 �"5��"9�:�B�
�
 �
 �/�A�"5�6��
�
 �
 �/�A�"5�6��
�
 �
 �/�A�"5�6��

��	
������,�,�.�5�5�x�@rc	�r�|jjt�tt�}tt�}|j
|dzfd|j
|dzfd|j
|dzfd|j
|dzfdi}|j
|jj�j|�yr�)	r{r�rMr$rFr|r�r�r�)r^r��firstlineno_calledr�s    r�test_trace_list_comprehensionz,TestLineCounts.test_trace_list_comprehension�s��������<�=�-�.N�O��,�^�<��
�
 �
 �"5��"9�:�A�
�
 �
 �"5��"9�:�B�
�
 �
 �"5��"9�:�A�
�
 �
 �"4�q�"8�9�2�	
��	
������,�,�.�5�5�x�@rc�B�|jjt�tt�}|j|dzfd|j|dzfd|j|dzfd|j|dzfd|j|dzfd|j|dzfd|j|dzfd|j|dzfd|j|d	zfd|j|d
zfd|j|dzfdi}|j|jj
�j|�y)Nr5rEr�r�r/r�r���	rAr�)r{r�rYr$r|r�r�r�r�s   r�test_traced_decorated_functionz-TestLineCounts.test_traced_decorated_function�s*�������5�6�%�&?�@��
�
 �
 �+��/�2�A�
�
 �
 �+��/�2�A�
�
 �
 �+��/�2�A�
�
 �
 �+��/�2�A�
�
 �
 �+��/�2�A�
�
 �
 �+��/�2�A�
�
 �
 �+��/�2�A�
�
 �
 �+��/�2�A�
�
 �
 �+��/�2�A�
�
 �
 �+��"2�3�Q�
�
 �
 �+��"2�3�Q�
��	
������,�,�.�5�5�x�@rc��dD]�}tdddd��}td�}t||�}|j|d�t	|�}|j
|dzfdi}|j
|j�j|���y)N)rar5rrr��)	r
r[�getattrr�r$r|r�r�r�)r^�methnamer{�
traced_obj�methodr�r�s       r�test_linear_methodsz"TestLineCounts.test_linear_methods�s���0�H���!���J�F�$�R��J��Z��2�F��N�N�6�2�&�)�&�1�K��$�$�k�A�o�6���H�
���V�^�^�-�4�4�h�?�0rN)rjrkrl�__doc__r~r�r�r�r�r�r�r�r&rrrprp~s4��9�3�

A�
A�
A�
A�A�A�&@rrpc��eZdZdZd�Zd�Zy)�TestRunExecCountsz8A simple sanity test of line-counting, via runctx (exec)c��tt�|_|jtj
t	j��yr)rrr|rwrxryrzr}s rr~zTestRunExecCounts.setUp�s'��(��2���������c�l�l�n�5rc	���tdddd��|_d}t|td�}|jj	|t�t
��tt�}|j|dzfd|j|dzfd|j|dzfd	|j|d
zfdi}|j�D]<}|j|jj�j|||��>y)Nr5rrrztraced_func_loop(2, 5)�execrEr�r�r/r�)r
r{�compiler�runctx�globals�varsr$r3r|�keysr�r�r�)r^�coder�r�r;s     r�test_exec_countsz"TestRunExecCounts.test_exec_counts�s����!�1���K���,���t�X�v�.�������4���D�F�3�%�&6�7��
�
 �
 �+��/�2�A�
�
 �
 �+��/�2�A�
�
 �
 �+��/�2�A�
�
 �
 �+��/�2�A�	
������A����T�[�[�0�0�2�9�9�!�<�h�q�k�J�!rN)rjrkrlr�r~r�r&rrr�r��s��B�6�Krr�c��eZdZdZd�Zd�Zd�Zd�Zd�Ze	jeed�xrej�d�d	��Zd
�Zy)�	TestFuncsz"White-box testing of funcs tracingc���|jtjtj��t	ddd��|_t
�|_tj�|_y)Nrr5)rsrtru)	rwrxryrzr
r{r�filemod�_saved_tracefuncr}s rr~zTestFuncs.setUpsB��������c�l�l�n�5��!�1��;���*�,��� #�����rc�\�|j� tj|j�yyr)r�rxryr}s r�tearDownzTestFuncs.tearDown
s%��� � �,��L�L��.�.�/�-rc���|jjtd�|jdzd|jdzdi}|j	|jj�j|�y)Nr5�r9r8)r{r�r9r�r�r��calledfuncs�r^r�s  r�test_simple_callerzTestFuncs.test_simple_callersc�������5�q�9�
�L�L�9�9�1��L�L�2�2�A�
��	
������,�,�.�:�:�H�Erc��|jjtdddd��}|j|dddd�f�|j	t
�5|jjtd��ddd�|j	t
�5|jj�ddd�y#1swY�BxYw#1swYyxYw)Nr5rEr�r�)r^r#)r5rE)r#�arg)r{r�rJr��assertRaises�	TypeError)r^�ress  r�test_arg_errorszTestFuncs.test_arg_errorss����k�k�!�!�/�1�a�a�a�!�H������v��1�'=�>�?�
�
�
�y�
)��K�K���_�!��<�*�
�
�
�y�
)��K�K���!�*�
)�*�
)��
)�
)�s�"B4�C�4B=�C	c�`�|jjtd�|jdzd|jdzd|jdzd|jdzdt	t
j�ddfdi}|j|jj�j|�y)Nr5r�r8�r<�r6rr#)
r{r�r<r�rrrr�r�r�r�s  r�test_loop_caller_importingz$TestFuncs.test_loop_caller_importing"s��������8�!�<�
�L�L�9�9�1��L�L�2�2�A��L�L�<�<�a��L�L�5�5�q�
��(�(�
)�9�f�=�q�
��	
������,�,�.�:�:�H�Errz�3pre-existing trace function throws off measurementsc�,�td�}|jj|jd�|jdzd|jdzd|jdzdi}|j|jj
�j|�y)Nr�r5)zTracedClass.inst_method_calling)zTracedClass.inst_method_linearr8)r[r{r�rcr�r�r�r�)r^�objr�s   r�test_inst_method_callingz"TestFuncs.test_inst_method_calling.s����"�o�������C�3�3�Q�7�
�L�L�?�?���L�L�>�>���L�L�2�2�A�
��
	
������,�,�.�:�:�H�Erc
�D�|jjt�|jdzd|jdzd|jdzd|jdzd|jdzdi}|j	|jj�j|�y)N)rYr5)rWrV)rRr")r{r�rYr�r�r�r�r�s  rr�z(TestFuncs.test_traced_decorated_function;s��������5�6�
�L�L�9�9�1��L�L�0�0�!��L�L�?�*�A��L�L�?�*�A��L�L�9�$�a�
��	
������,�,�.�:�:�H�ErN)rjrkrlr�r~r�r�r�r��unittest�skipIf�hasattrrxrzr�r�r&rrr�r�sb��,�/�0�F�"�
F��X�_�_�W�S�*�-�@�,�#�,�,�.�J�L�	F�L�	F�
Frr�c�|�eZdZdZd�Zejeed�xrej�d�d��Z
y)�TestCallersz$White-box testing of callers tracingc��|jtjtj��t	ddd��|_t
�|_y)Nrr5)rsrtrv�rwrxryrzr
r{rr�r}s rr~zTestCallers.setUpJs4��������c�l�l�n�5��!�1�1�=���*�,��rrzr�c�D�|jjtd�tjjtj�ddzddf|jdzfd|jdz|jdzfd|jdz|jdzfd|jdz|jd	zfd|jd	zttj�d
dffdi}|j|jj�j|�y)Nr5r�.pyrtz
Trace.runfuncr�r�r8r�rr#)r{r�r<rrrrtrr�rrr�r��callersr�s  rr�z&TestCallers.test_loop_caller_importingOs��	
�����8�!�<��g�g���u�~�~�.�q�1�E�9�7�O�
T���� A�A�
D�EF��l�l�;�;���� 7�7�
:�;<��l�l�>�>���� >�>�
A�BC��l�l�>�>���� :�:�
=�>?��l�l�7�7��G�,�,�-�y�&�A�
C�DE�
��	
������,�,�.�6�6��ArN)rjrkrlr�r~r�r�r�rxrzr�r&rrr�r�HsF��.�-�
�X�_�_�W�S�*�-�@�,�#�,�,�.�J�L�B�L�Brr�c�T�eZdZd�Zd�ZdZefd�Zed�d��Zd�Z	d�Z
d	�Zy
)�TestCoveragec�h�|jtjtj��yr)rwrxryrzr}s rr~zTestCoverage.setUpes��������c�l�l�n�5rc�@�tt�tt�yr)rrrr}s rr�zTestCoverage.tearDownhs���v���v�rz�if True:
        import unittest
        from test.test_pprint import QueryTestCase
        loader = unittest.TestLoader()
        tests = loader.loadTestsFromTestCase(QueryTestCase)
        tests(unittest.TestResult())
        c�v�|j|�|j�}|jddt��y)NT)�show_missing�summary�coverdir)�runr��
write_resultsr)r^r{�cmd�rs    r�	_coveragezTestCoverage._coveragess+���
�
�3���N�N���	���T�4�&��Ir�cpuc�t�tjdd��}t�5}|j|�ddd�j	�}|jd|�|jd|�t
jt�}|jd|�|jd|�y#1swY�{xYw)Nrr5�rtrsz	pprint.pyzcase.pyzpprint.coverzunittest.case.cover)	rtr
rr��getvalue�assertInr�listdirr)r^r{�stdout�filess    r�
test_coveragezTestCoverage.test_coveragexs������1�A�.��
�
�&��N�N�6�"�����"���
�
�k�6�*��
�
�i��(��
�
�6�"���
�
�n�e�,��
�
�+�U�3��
�s�B.�.B7c�,�tjjtjjtjjt���}tjtjtj|gdd��}t�5}|j|�ddd�tjjt�r-tjt�}|j|dg�yy#1swY�ZxYw)Nrr5)�
ignoredirsrtrsz_importlib.cover)rr�normpath�dirnamerrtr
rx�base_prefix�base_exec_prefixrr��existsrr�r�)r^�libpathr{r�r�s     r�test_coverage_ignorez!TestCoverage.test_coverage_ignore�s����'�'�"�"�2�7�7�?�?�2�7�7�?�?�8�3L�#M�N��������#�:N�:N�$�)&�-.�a�9��
�
�&��N�N�6�"��
�7�7�>�>�&�!��J�J�v�&�E����U�%7�$8�9�"��
�s�D
�
Dc�J�tjdd��}d}|tjvrtj|=d}t	�5}|j||�ddd�j
d�|j�i}|D]5}|j�dd\}}}	t|�t|dd�f||	<�7tjtj|j�}|j||�|j||d�y#1swY��xYw)	Nrr5r�ztest.tracedmodules.testmodz<import test.tracedmodules.testmod as t;t.func(0); t.func2();r�r)r/�d)rtr
rx�modulesrr��seek�readline�split�int�_fullmodnamerr�r�)
r^r{rr�r��coverage�line�lines�cov�modules
          r�test_issue9936zTestCoverage.test_issue9936�s������1�A�.��.���c�k�k�!����G�$�'��
�
�&��N�N�6�3�'�����A���������D�!%����b�q�!1��E�3�� #�E�
�C��C�R��M�:�H�V����$�$�S�[�[��%9�%B�%B�C���
�
�g�x�(�����'�*�H�5��
�s�	D�D"c��tdz}t|d�5}tiiddif|d��ddd�|jt|�tjii|i�}|j|jddi�y#1swY�VxYw)Nz-infile�wb�callerr5)�protocol)	r�openrrwrrt�CoverageResultsr�r�)r^�infilerQr�s    r�test_coverageresults_updatez(TestCoverage.test_coverageresults_update�sy���)�#��
�&�$�
�1��"�b�8�Q�-�(�!�a�8� ������'��'�'��B���;��������8�Q�-�8�	 �
�s�A?�?BN)rjrkrlr~r��DEFAULT_SCRIPTr�rr�r�rrr&rrr�r�dsF��6���N�%3�J�
�u��	4��	4�
:�6�*9rr�c��eZdZd�Zy)�Test_Ignorec	�0�tjj}tjddg|dd�g�}|j|j
dd��|j|j
dd��|j|j
dd	��|j|j
|ddd
�d��|j|j
|dd�d
��|j|j
|dd
�d��y)Nr'zy.z�foo�barzx.pyzxy.py�xyzy.pyr(zbaz.py�bazzz.py�z)rr�joinrt�_Ignore�
assertTrue�names�assertFalse)r^�jn�ignores   r�test_ignoredzTest_Ignore.test_ignored�s���
�W�W�\�\������U�|�b���.>�-?�@��������V�S�1�2�������g�t�4�5�������f�c�2�3�������R��u�h�%?��G�H�������b���&7��=�>�������R��x�%8�%�@�ArN)rjrkrlrr&rrrr�s��	Brrc�,�eZdZdZdZd�Zd�Zd�Zd�Zy)�TestCoverageCommandLineOutputztmp.pyz	tmp.coverc��t|jdd��5}|jtjd��ddd�y#1swYyxYw)N�w�iso-8859-15��encodingu�                # coding: iso-8859-15
                x = 'spœm'
                if []:
                    print('unreachable')
            )r	�codefile�write�textwrap�dedent)r^rQs  rr~z#TestCoverageCommandLineOutput.setUp�s<��
�$�-�-��}�
=��
�G�G�H�O�O�%��
�>�
=�
=�s�%A�Ac�X�t|j�t|j�yr)rr%�	coverfiler}s rr�z&TestCoverageCommandLineOutput.tearDown�s���t�}�}���t�~�~�rc���tjjtjjtj
��}tjj
|d�}t|�dj�|jgz}t|�\}}}|j|d�|jtjj|��|jtjj|j��t!|jd��5}|j|j#�d�ddd�y#1swYyxYw)Nztrace.coverz-m trace --countrr"r#u^       # coding: iso-8859-15
    1: x = 'spœm'
    1: if []:
           print('unreachable')
)rrr��abspathrtrrrr�r%r
r�rr�rr*r	�read)r^�tracedir�tracecoverpath�argv�statusr��stderrrQs        r�%test_cover_files_written_no_highlightzCTestCoverageCommandLineOutput.test_cover_files_written_no_highlight�s����7�7�?�?�2�7�7�?�?�5�>�>�#B�C�������h�
�>���~��!�'�'�)�T�]�]�O�;��!1�4�!8����������%����������7�8���������t�~�~�6�7�
�$�.�.�=�
9�Q����Q�V�V�X�4�
�:�
9�
9�s�/!E�E"c��dj�|jgz}t|�\}}}|jtj
j
|j��t|jd��5}|j|j�tjd��ddd�y#1swYyxYw)Nz-m trace --count --missingr"r#u�                       # coding: iso-8859-15
                    1: x = 'spœm'
                    1: if []:
                >>>>>>     print('unreachable')
            )
r�r%r
rrrr�r*r	r�r-r'r()r^r0r1r�r2rQs      r�'test_cover_files_written_with_highlightzETestCoverageCommandLineOutput.test_cover_files_written_with_highlight�s���+�1�1�3�t�}�}�o�E��!1�4�!8�������������t�~�~�6�7�
�$�.�.�=�
9�Q����Q�V�V�X�x���8�(�
�:�
9�
9�s�:4B7�7CN)	rjrkrlr%r*r~r�r3r5r&rrrr�s ���H��I����(
rrc�*�eZdZd�Zd�Zd�Zd�Zd�Zy)�TestCommandLinec�^�d}|D]&^}}tddg|����^}}|j||��(y)N))s3progname is missing: required with the main options�-lz-T)s8cannot specify both --listfuncs and (--trace or --count)z-lc)s>argument -R/--no-report: not allowed with argument -r/--reportz-rR)sLmust specify one of --trace, --count, --report, --listfuncs, or --trackcallsz-g)s-r/--report requires -f/--filez-r)s3--summary can only be used with --count or --reportz-sT)sunrecognized arguments: -yz-y�-mrt)rr�)r^�_errors�messagerH�_r2s      r�
test_failureszTestCommandLine.test_failures�s<��3��&�N�G�d�.�t�W�D�t�D�J�Q���M�M�'�6�*�&rc��tdz}tjjt�}t	|dd��5}|jt|�|jd�tddd|d�	�\}}}|jd
|�d|�d|�d
�}|j|j�|�ddd�y#1swYyxYw)Nr�r!�utf-8r#za = 1
r:rtr9��PYTHONIOENCODINGsfunctions called:z
filename: z, modulename: z, funcname: <module>)rrrrr	rwrr&r
r��encode)r^r�
modulename�fdr1r�r2r�s        r�test_listfuncs_flag_successz+TestCommandLine.test_listfuncs_flag_success�s����E�>���W�W�%�%�f�-�
�
�(�C�'�
2�b��O�O�F�H�-��H�H�Y��%5�d�G�T�8�GN�&P�"�F�F�F��M�M�.��7�#�H�:�^�J�<�G[�\�H��M�M�(�/�/�+�V�4�3�
2�
2�s�A7B;�;Cc�`�ttdd��5}|jtt�|j	d�|j	d�ddd�tt�\}}}tdddtd�	�\}}}|j
|j�|�y#1swY�UxYw)
Nr!r@r#zimport sys
zprint(type(sys.argv))
r:rtr9rA)r	rrwrr&r
r��strip)r^rEr1�
direct_stdoutr2�trace_stdouts      r�test_sys_argv_listz"TestCommandLine.test_sys_argv_lists���
�&�#��
0�B��O�O�F�F�+��H�H�^�$��H�H�.�/�1�
)9��(@�%��
�v�'7��g�t�V�IP�(R�$���f��
�
�m�)�)�+�\�:�1�
0�s�=B$�$B-c��t�d�}t�d�}tjjt�}t	|dd��5}|jt|�|jt|�|jtjd��ddd�tddd	|d�
�\}}}|j�}|j|d�|jd|�|jd
|�d|�d�|�y#1swY�kxYw)Nr�z.coverr!r@r#z�                x = 1
                y = 2

                def f():
                    return x + y

                for i in range(10):
                    f()
            r:rtz-csrArzlines   cov%   module   (path)z6   100%   z   (�))rrrrr	rwrr&r'r(r
�decoder�r�)r^r�
coverfilenamerDrEr1r�r=s        r�test_count_and_summaryz&TestCommandLine.test_count_and_summarys����X�S�>��!�(�&�)�
��W�W�%�%�f�-�
�
�(�C�'�
2�b��O�O�F�H�-��O�O�F�M�2��H�H�X�_�_�	&�	�	
�3�-�T�7�E�8�>E�G���������������#��
�
�6��?��
�
��J�<�t�H�:�Q�?��H�%3�
2�s
�AC?�?Dc	�D�tddddddd�tddddd�y)	Nr:rtr9z--module�timeitz-n�1�not_a_module_zzzr	r}s r�test_run_as_modulez"TestCommandLine.test_run_as_module.s'����w��j�(�D�#�N��d�G�T�:�?Q�RrN)rjrkrlr>rFrKrPrUr&rrr7r7�s��+�
5�	;�I�0Srr7c��eZdZd�Zd�Zy)�	TestTracec��|jtjtj��t	dd��|_t
�|_y)Nrr5)rsrtr�r}s rr~zTestTrace.setUp4s2��������c�l�l�n�5��!�1�-���*�,��rc��d}tj}|j|��}t|t	��}t�5}|jj|dd�ddd�j�j�}t|�}|jd|jd�d|jj��|d�|j|�d	|dz�d
�|d�|j|�d	|dz�d
�|d�|j|�d	|dz�d
�|d�|j|�d	|dz�d
�|d�y#1swY��xYw)Nz	<unknown>)�co_filenamerEr�z --- modulename: r5z, funcname: r�(rMr�)r,r �replacerr�rr{r�r��
splitlinesr$r�r��co_name)r^r�corQ�outr�s      r�test_no_source_filezTestTrace.test_no_source_file9sC����
�
(�
(��
�Z�Z�H�Z�
-����W�Y�'��
�
�#��K�K����1�a�(���l�l�n�'�'�)��%�a�(���
�
�)�$�,�,�q�/�):�,�q�z�z�GY�GY�FZ�[�]`�ab�]c�d��
�
��
�!�K�!�O�#4�A�6��A��?��
�
��
�!�K�!�O�#4�A�6��A��?��
�
��
�!�K�!�O�#4�A�6��A��?��
�
��
�!�K�!�O�#4�A�6��A��?��
�s�E�EN)rjrkrlr~rar&rrrWrW3s
��-�
@rrW�__main__)2r�picklerrx�test.supportrr�test.support.os_helperrrr�test.support.script_helperr
rr'r��typesrrtr
�test.tracedmodulesrrrr$r,r3r6r9r<r?rBrFrJrMrY�objectr[�TestCaserpr�r�r�r�rrr7rWrj�mainr&rr�<module>rlsU��	��
�;�;�;�N������&��)�
(�
�
�#��
�
�
�
���
��&��.h@�X�&�&�h@�VK��)�)�K�8@F��!�!�@F�FB�(�#�#�B�8H9�8�$�$�H9�Z
B�(�#�#�
B�0�H�$5�$5�0�d@S�h�'�'�@S�F@��!�!�@�0�z���H�M�M�O�r

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists