HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/test/__pycache__/test_doctest.cpython-310.opt-2.pyc
o

�ih��@s>	ddlmZddlmZddlmZddlZddlZddlZddlZddl	Z	ddl
Z	ddlZ	ddlZddl
Z
ddlZddlZddlZdd�ZGdd�d�ZGd	d
�d
e�ZGdd�d�Zd
d�Zdd�ZGdd�d�ZGdd�dej�Zdd�ZGdd�d�Zdd�Zdd�Zeed�r�e� �s�dd�Z!d d!�Z"d"d#�Z#d$d%�Z$d&d'�Z%Gd(d)�d)�Z&e&d*d+��Z'd,d-�Z(d.d/�Z)Gd0d1�d1e	j*j+e	j*j,�Z-Gd2d3�d3�Z.ej/d4d5��Z0d6d7�Z1d8d9�Z2ze�3d:�Wn	e4y�Ynwd;d<�Z5d=d>�Z6d?d@�Z7dAdB�Z8dCdD�Z9dEdF�Z:e;dGk�rdHej<v�re:dI�dSe�=�dSdS)J�)�support)�
import_helper)�	os_helperNcCs
	||S�N���vrr�./usr/local/lib/python3.10/test/test_doctest.py�sample_funcsr
c@steZdZ	dd�Zdd�Zdd�Zdd�Zee�Zd	d
�Ze	e�Ze
edd�Zd
Ze	e
dd���Z
Gdd�d�ZdS)�SampleClasscC�	||_dSr��val��selfrrrr	�__init__8�
zSampleClass.__init__cC�	t|j|j�Sr)rr�rrrr	�double?�zSampleClass.doublecC�	|jSrr
rrrr	�getF�zSampleClass.getcCs
	|dS)N�rrrrr	�a_staticmethodMszSampleClass.a_staticmethodcCs
	|dS)N�r)�clsrrrr	�
a_classmethodUszSampleClass.a_classmethodzB
        >>> print(SampleClass(22).a_property)
        22
        )�doc�*cCrr)�a_class_attribute)rrrr	�a_classmethod_propertyfsz"SampleClass.a_classmethod_propertyc@s(eZdZ	d	dd�Zdd�Zdd�ZdS)
zSampleClass.NestedClassrcCrrr
rrrr	rvrz SampleClass.NestedClass.__init__cCst�|j|j�Sr)r�NestedClassrrrrr	�square|�zSampleClass.NestedClass.squarecCs|jSrr
rrrr	r~szSampleClass.NestedClass.getN)r)�__name__�
__module__�__qualname__rr$rrrrr	r#os

r#N)r&r'r(rrrr�staticmethodr�classmethod�propertyZ
a_propertyr!r"r#rrrr	r(src@s&eZdZ	dd�Zdd�Zdd�ZdS)�SampleNewStyleClasscCrrr
rrrr	r�rzSampleNewStyleClass.__init__cCrr)r,rrrrr	r�rzSampleNewStyleClass.doublecCrrr
rrrr	r�rzSampleNewStyleClass.getN)r&r'r(rrrrrrr	r,�s
r,c@seZdZ	dd�Zdd�ZdS)�
_FakeInputcCs
||_dSr)�lines)rr.rrr	r�s
z_FakeInput.__init__cCs|j�d�}t|�|dS)Nr�
)r.�pop�print)r�linerrr	�readline�sz_FakeInput.readlineN)r&r'r(rr3rrrr	r-�sr-cC�dSrrrrrr	�test_Example��r5cCr4rrrrrr	�test_DocTest-r6r7c@s&eZdZdd�Zejrdd�ZdSdS)�test_DocTestFindercCr4rrrrrr	�basics�r6ztest_DocTestFinder.basicscCr4rrrrrr	�non_Python_modules�r6z%test_DocTestFinder.non_Python_modulesN)r&r'r(r9�int�__doc__r:rrrr	r8�s�r8c@�eZdZdd�Zdd�ZdS)�TestDocTestFinderc
CsZddlm}t�d�}||jd<z
tj|dd�WdSty,}zt�d�|�d}~ww)Nr)�callZdummyZinject_callT)�	verbosityzDoctest unwrap failed)	Z
unittest.mockr?�types�
ModuleType�__dict__rZrun_doctest�
ValueErrorZ
TestFailed)rr?Zdummy_module�errr	�test_issue35753�s

��z!TestDocTestFinder.test_issue35753c
Cs�d}t���Z}tj�||�}t�|�tj�|�zt�	|�}Wt
�|�tj��nt
�|�tj��wt
jdd�}t
jdd�}|�t|�|��d�|�t|�|��d�Wd�dS1scwYdS)NZdoctest_empty_pkgF)Z
exclude_emptyTrr)�tempfile�TemporaryDirectory�os�path�join�mkdir�sys�append�	importlib�
import_modulerZforgetr0�doctestZ
DocTestFinderZassertEqual�len�find)rZpkg_nameZ
parent_dirZpkg_dir�modZinclude_empty_finderZexclude_empty_finderrrr	�test_empty_namespace_package�s 



�"�z.TestDocTestFinder.test_empty_namespace_packageN)r&r'r(rFrUrrrr	r>�sr>cCr4rrrrrr	�test_DocTestParserr6rVc@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�test_DocTestRunnercCr4rrrrrr	r98r6ztest_DocTestRunner.basicscCr4rrrrrr	�verbose_flagur6ztest_DocTestRunner.verbose_flagcCr4rrrrrr	�
exceptions�r6ztest_DocTestRunner.exceptionscCr4rrrrrr	�displayhook�r6ztest_DocTestRunner.displayhookcCr4rrrrrr	�optionflags�r6ztest_DocTestRunner.optionflagscCr4rrrrrr	�option_directivestr6z$test_DocTestRunner.option_directivesN)	r&r'r(r9rXrYrZr[r\rrrr	rW7s=Co4rWcCr4rrrrrr	�test_testsourceLr6r]cCr4rrrrrr	�
test_debugtr6r^�gettracecCr4rrrrrr	�test_pdb_set_trace��r`cCr4rrrrrr	�test_pdb_set_trace_nestedrarbcCr4rrrrrr	�test_DocTestSuiteorarccCr4rrrrrr	�test_DocFileSuite�rardcCr4rrrrrr	�test_trailing_space_in_test�	rarec@r=)�WrappercCs||_t�||�dSr)�func�	functools�update_wrapper)rrgrrr	r�	szWrapper.__init__cOs|j|i|��dSr)rg)r�args�kwargsrrr	�__call__�	szWrapper.__call__N)r&r'r(rrlrrrr	rf�	srfcCr4rrrrrr	�test_look_in_unwrapped�	srmcCr4rrrrrr	�test_unittest_reportflags�	rarncCr4rrrrrr	�
test_testfile�	r6roc@seZdZddd�Zdd�ZdS)�TestImporterNcCstjj|||d�S)N)�loader)rO�util�spec_from_file_location)r�fullnamerJ�targetrrr	�	find_spec�
r%zTestImporter.find_speccCs8t|dd��}|��Wd�S1swYdS)N�rb)�mode)�open�read)rrJ�frrr	�get_data�
s$�zTestImporter.get_datar)r&r'r(rvr|rrrr	rp�
s
rpc@r=)�TestHookcCsltjdd�|_tjdd�|_tjdd�|_tj�|�tj��tj�	�|_
t�|_tj�|j�dSr)
rMrJ�sys_path�	meta_path�
path_hooksrN�path_importer_cache�clear�modules�copy�modules_beforerpZimporter)r�pathdirrrr	r�
s
zTestHook.__init__cCsV|jtjdd�<|jtjdd�<|jtjdd�<tj��tj��tj�|j	�dSr)
r~rMrJrr�r�r�r��updater�rrrr	�remove�
s

zTestHook.removeN)r&r'r(rr�rrrr	r}�
s
r}ccs*�t|�}z
|VW|��dS|��wr)r}r�)r��hookrrr	�	test_hook�
s
�r�cCr4rrrrrr	�test_lineendings�
r6r�cCr4rrrrrr	�test_testmodr6r�ufoo-bär@baz.pycCr4rrrrrr	�test_unicode#r6r�cCr4rrrrrr	�test_CLI>r6r�cCs	dSrrrrrr	�%test_no_trailing_whitespace_stripping$sr�cCr4rrrrrr	�$test_run_doctestsuite_multiple_timesNrar�cCs"|�t�t��|�t���|Sr)ZaddTestrQZDocTestSuite)rqZtests�patternrrr	�
load_tests^sr�cCsPt�d�}|jtjtjgddd�}|�d�|��}td�|j	dd|d�dS)	N�tracerr)Z
ignoredirsr��countztest_main()zWriting coverage results...T)Zshow_missingZsummary�coverdir)
rrPZTracerM�base_prefix�base_exec_prefix�run�resultsr1Z
write_results)r�r�Ztracer�rrrr	�
test_coverageds
�

�r��__main__z-cz/tmp/doctest.cover)>�testrZtest.supportrrrQrhrIrMrOZ
importlib.abc�importlib.utilZunittestrG�shutilrA�
contextlibr
r�objectr,r-r5r7r8ZTestCaser>rVrWr]r^�hasattrr_r`rbrcrdrerfrmrnro�abcZMetaPathFinderZResourceLoaderrpr}�contextmanagerr�r�r��fsencode�UnicodeEncodeErrorr�r�r�r�r�r�r&�argv�mainrrrr	�<module>s�
Y y0 7(Vu'	
O1	
H�g*
�