????

Your IP : 18.222.156.75


Current Path : /lib/python3.10/test/libregrtest/__pycache__/
Upload File :
Current File : //lib/python3.10/test/libregrtest/__pycache__/runtest.cpython-310.pyc

o

�*�g1�	@sBddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddlm
Z
ddlmZddlmZddlmZmZmZGdd�d�ZGd	d
�d
e�ZGdd�de�ZGd
d�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�Z Gdd�de�Z!dZ"gd �Z#e$�Z%gZ&d!ed"ed#e'fd$d%�Z(d>d&d'�Z)de#e%fd(d)�Z*d"ed*e+d#e+fd+d,�Z,d"ed*e+d#efd-d.�Z-d"ed*e+d#efd/d0�Z.d1d2�Z/d"ed*e+fd3d4�Z0d"ed*e+d#e'fd5d6�Z1	7d?d"ed*e+d8e'd#efd9d:�Z2d*e+d;e3d#dfd<d=�Z4dS)@�N)�support)�	os_helper)�	Namespace)�saved_test_environment)�clear_caches�format_duration�
print_warningc	@sBeZdZ		ddededeedBddfdd�Zdefd	d
�ZdS)�
TestResult�N�name�duration_sec�xml_data�returncCs||_||_||_dS�N)rrr
)�selfrrr
�r�//usr/lib/python3.10/test/libregrtest/runtest.py�__init__s
zTestResult.__init__cC�|j�d�S)Nz	 finished�r�rrrr�__str__�zTestResult.__str__)r
N)�__name__�
__module__�__qualname__�str�float�listrrrrrrr	s���
�
�
r	c@�eZdZdefdd�ZdS)�PassedrcCr)Nz passedrrrrrr#rzPassed.__str__N�rrrrrrrrrr "�r csveZdZ				d
dededeedBdeeeefdBdeeeefdBddf�fd	d
�
Zdefdd�Z�Z	S)�Failedr
Nrrr
�errors�failuresrcs"t�j|||d�||_||_dS)N)rr
)�superrr$r%)rrrr
r$r%��	__class__rrr(s
zFailed.__init__c
Cs�|jr6|jr6t|j�}t|j�}d|dkrdnd}d|dkr!dnd}|j�d|�d|�d|�d|�d	�
S|jrTt|j�}d|dkrEdnd}|j�d|�d|�d	�S|jrrt|j�}d|dkrcdnd}|j�d|�d|�d	�S|j�d
�S)N�error��s��failurez	 failed (� z, �)� failed)r$r%�lenr)r�le�lf�error_s�	failure_srrrr4s

$

zFailed.__str__)r
NNN)
rrrrrr�tuplerr�
__classcell__rrr'rr#'s&���
����r#c@r)�UncaughtExceptionrcCr)Nz failed (uncaught exception)rrrrrrJrzUncaughtException.__str__Nr!rrrrr8Ir"r8c@r)�
EnvChangedrcCr)Nz failed (env changed)rrrrrrOrzEnvChanged.__str__Nr!rrrrr9Nr"r9c@r)�RefLeakrcCr)Nz failed (reference leak)rrrrrrTrzRefLeak.__str__Nr!rrrrr:Sr"r:c@r)�SkippedrcCr)Nz skippedrrrrrrYrzSkipped.__str__Nr!rrrrr;Xr"r;c@r)�ResourceDeniedrcCr)Nz skipped (resource denied)rrrrrr^rzResourceDenied.__str__Nr!rrrrr<]r"r<c@r)�InterruptedrcCr)Nz interruptedrrrrrrcrzInterrupted.__str__Nr!rrrrr=br"r=c@r)�
ChildErrorrcCr)Nz crashedrrrrrrhrzChildError.__str__Nr!rrrrr>gr"r>c@r)�	DidNotRunrcCr)Nz
 ran no testsrrrrrrmrzDidNotRun.__str__Nr!rrrrr?lr"r?c@r)�TimeoutrcCs|j�dt|j��d�S)Nz timed out (r/)rrrrrrrrrszTimeout.__str__Nr!rrrrr@qr"r@g>@)
�test_grammar�test_opcodes�	test_dict�test_builtin�test_exceptions�
test_types�
test_unittest�test_doctest�
test_doctest2�test_support�result�nsrcCst|t�r|jSt|t�Sr)�
isinstancer9�fail_env_changedr#)rKrLrrr�	is_failed�s

rOcCs|ptj�tj�t��ptjSr)�os�path�dirname�__file__�curdir)rQrrr�findtestdir�srUc	Csrt|�}t�|�}g}t|�|B}|D]}tj�|�\}}|dd�dkr2|dvr2||vr2|�|�q|t|�S)z-Return a list of all applicable test modules.N��test_)z.pyr,)rUrP�listdir�setrQ�splitext�append�sorted)	�testdir�stdtests�nottests�names�tests�othersr�mod�extrrr�	findtests�s
 
�re�	test_namecCs|�d�s|jr
|Sd|S)Nztest.)�
startswithr]�rLrfrrr�get_abs_module�sricsX|j}|jdu}|rtj|jdd�t��}z�t�|j|j	�|j
r$gndt_}|jr/dt_|rmdt_
t��}tj}tj}z'|t_|t_t||dd�}	t|	t�s^|��}
|�|
�|��W|t_|t_n|t_|t_w|j
t_
t|||j
d�}	|r�ddlmm��fdd�|D�|	_t��||	_|	W|r�t��dt_S|r�t��dt_w)NT)�exitF)�display_failurercsg|]
}��|��d��qS)zus-ascii)�tostring�decode)�.0�x��ETrr�
<listcomp>�s��z_runtest.<locals>.<listcomp>)�verbose3�timeout�faulthandler�dump_traceback_later�time�perf_counterr�set_match_tests�match_tests�ignore_tests�xmlpath�junit_xml_list�failfast�verbose�io�StringIO�sys�stdout�stderr�_runtest_innerrMr �getvalue�write�flush�xml.etree.ElementTree�etree�ElementTreer
r�cancel_dump_traceback_later)rLrf�output_on_failure�use_timeout�
start_time�xml_list�stream�orig_stdout�orig_stderrrK�outputrrpr�_runtest�s^
�

���
��r�cCsJzt||�WS|jst��}td|�d|��tjdd�t|�YS)aRun a single test.

    ns -- regrtest namespace of options
    test_name -- the name of the test

    Returns a TestResult sub-class depending on the kind of result received.

    If ns.xmlpath is not None, xml_data is a list containing each
    generated testsuite element.
    �test � crashed -- T��filer�)r��pgo�	traceback�
format_exc�printr�r�r#)rLrf�msgrrr�runtest�s�r�cCsHt��}|�|�}|jD]	}t|tjd�q|jrtd��t�	|�dS)N)r�zerrors while loading tests)
�unittest�
TestLoader�loadTestsFromModuler$r�r�r��	Exceptionr�run_unittest)�
the_module�loaderrar)rrr�_test_module�s

r�cCst||j|j|jd�S)N)r�)rr�quietr�rhrrr�save_envsr�c	Cst||�}ztj|=Wn	tyYnwt�|�}|jr#ddlm}t	|dd�}|dur3t
�t|�}z,t
||��|jrD||||�}n|�d}Wd�n1sSwYWt||j�nt||j�wt��tjr�dt_t|�dttj��d��t�tj�tj��t��|S)Nr)�dash_R�	test_mainFTz	 created z uncollectable object(s).)rir��modules�KeyError�	importlib�
import_module�
huntrleaks�test.libregrtest.refleakr��getattr�	functools�partialr�r��cleanup_test_droppingsrr�
gc_collect�gc�garbage�environment_alteredrr1�
FOUND_GARBAGE�extend�clear�
reap_children)rLrf�abstestr�r��test_runner�refleakrrr�_runtest_inner2s<
�
���
r�Trkc
CsFdt_|jrd}zt�t||��
t||�}Wd�n1s!wYWn�tjyO}z|jsA|jsAt|�d|��dd�t|�WYd}~Sd}~wt	j
yv}z|jsh|jsht|�d|��dd�t|�WYd}~Sd}~wtjy�}z&d|�d�}|r�|�d|��}t|t
jdd�t||j|jd	�WYd}~Sd}~wtjy�}z!d|�d�}|r�|�d|��}t|t
jdd�t|�WYd}~Sd}~wtjy�t|�YSty�t�t|�YS|j�s
t��}td|�d
|��t
jdd�t|�YS|�rt|�Stj�rt|�St|�S)NFz skipped -- T)r�r�r0z -- r�)r$r%r�)rr�r�rr�r�r<r�r�r��SkipTestr;�TestFailedWithDetailsr�r�r#r$r%�
TestFailed�
TestDidNotRunr?�KeyboardInterruptr=r�r�r8r:r9r )rLrfrkr�r��excrrrr�?sd�������r�rcCst��tjfD]x}tj�|�sqtj�|�r"ddl}d|j	}}ntj�
|�r/dtj}}ntd|�d���|rHt
|�d|�d|���dt_zddl}t�||j|jB|jB�||�Wqty�}zt
|�d|�d|�d	|���WYd}~qd}~wwdS)
Nr�	directoryr�z
os.path says z) exists but is neither directory nor filez
 left behind r.Tz and it couldn't be removed: )rr�r�TESTFNrPrQ�exists�isdir�shutil�rmtree�isfile�unlink�RuntimeErrorrr��stat�chmod�S_IRWXU�S_IRWXG�S_IRWXOr�)rfrrr��kind�nukerr�r�rrrr�ws0����r�r)T)5rur�r�r�r�rPr�rwr�r��testr�test.supportr�test.libregrtest.cmdliner�test.libregrtest.save_envr�test.libregrtest.utilsrrrr	r r#r8r9r:r;r<r=r>r?r@�PROGRESS_MIN_TIME�STDTESTSrY�NOTTESTSr��boolrOrUrerrir�r�r�r�r�r��intr�rrrr�<module>sf"

9
4����
�8

Page not found | The NCLEX Doctor

Page not found!

Sorry, this page is not available...