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੐)|#o0aڱ$I>}k&1`U#V?YsV x>{t1[I~D&(I$I/{H0fw"q"y%4 IXyE~M3 8XψL}qE$I[> nD?~sf ]o΁ cT6"?'_Ἣ $I>~.f|'!N?⟩0G KkXZE]ޡ;/&?k OۘH$IRۀwXӨ<7@PnS04aӶp.:@\IWQJ6sS%I$e5ڑv`3:x';wq_vpgHyXZ 3gЂ7{{EuԹn±}$I$8t;b|591nءQ"P6O5i }iR̈́%Q̄p!I䮢]O{H$IRϻ9s֧ a=`- aB\X0"+5"C1Hb?߮3x3&gşggl_hZ^,`5?ߎvĸ%̀M!OZC2#0x LJ0 Gw$I$I}<{Eb+y;iI,`ܚF:5ܛA8-O-|8K7s|#Z8a&><a&/VtbtLʌI$I$I$I$I$I$IRjDD%tEXtdate:create2022-05-31T04:40:26+00:00!Î%tEXtdate:modify2022-05-31T04:40:26+00:00|{2IENDB`Mini Shell

HOME


Mini Shell 1.0
DIR:/snap/core/current/usr/lib/python3.5/test/__pycache__/
Upload File :
Current File : //snap/core/current/usr/lib/python3.5/test/__pycache__/regrtest.cpython-35.pyc


ճ�fL��"@s�dZdZdZdZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlmZyddlZWnek
rNdZYnXyddlZddlZWnek
r�dZYnXxfej j!�D]UZ"e#e"d�r�dd	�e"j$D�e"_$e#e"d
�r�ej%j&e"j'�e"_'q�Wej
dkrpyddl(Z(Wnek
r"YnNXe(j)e(j*�\Z+Z,e-e,e.e+dd
��Z/e(j0e(j*e/e,f�dZ1dZ2dZ3dZ4dZ5dZ6dZ7ddl8m9Z9dddddddddf	Z:ej;�r�ej%j<ej=d�d�Z>nej?�Z>ej%j&e>�Z>Gdd �d ej@�ZAd!d"�ZBd#d$�ZCd%d&�ZDd'd(�ZEd)d*�ZFd+d,�ZGdd-d.�ZHd/d0d1d2d3d4d5d6d7d8g
ZIeJ�ZKdeIeKd9d:�ZLGd;d<�d<eM�ZNd=d>�ZOd?dd?d?ddd@d?dAdB�ZPdeP_QGdCdD�dD�ZRd?dEd?dFdG�ZSdHdI�ZTdJdK�ZUdLdM�ZVdNdO�ZWddPdQ�ZXdRdS�ZYdTdU�ZZdVddWdX�Z[dYdZ�Z\e]d[kr�ej%j&ej%j^ej%j_ej`d���Zaebej%�ZcxOecdkrVecd8Zcej%j&ej%j^ej%ec��eakrSej%ec=qWej%j&e'�Z'e'ej%j&ej`d�ks�td�e\�dS)\z^
Script to run Python regression tests.

Run this script with -h or --help for documentation.
z�python -m test [options] [test_name1 [test_name2 ...]]
python path/to/Lib/test/regrtest.py [options] [test_name1 [test_name2 ...]]
a`Run Python regression tests.

If no arguments or options are provided, finds all files matching
the pattern "test_*" in the Lib/test subdirectory and runs
them in alphabetical order (but see -M and -u, below, for exceptions).

For more rigorous testing, it is useful to use the following
command line:

python -E -Wd -m test [options] [test_name1 ...]
a%Additional option details:

-r randomizes test execution order. You can use --randseed=int to provide an
int seed value for the randomizer; this is useful for reproducing troublesome
test orders.

-s On the first invocation of regrtest using -s, the first test file found
or the first test file given on the command line is run, and the name of
the next test is recorded in a file named pynexttest.  If run from the
Python build directory, pynexttest is located in the 'build' subdirectory,
otherwise it is located in tempfile.gettempdir().  On subsequent runs,
the test in pynexttest is run, and the next test is written to pynexttest.
When the last test has been run, pynexttest is deleted.  In this way it
is possible to single step through the test files.  This is useful when
doing memory analysis on the Python interpreter, which process tends to
consume too many resources to run the full regression test non-stop.

-S is used to continue running tests after an aborted run.  It will
maintain the order a standard run (ie, this assumes -r is not used).
This is useful after the tests have prematurely stopped for some external
reason and you want to start running from where you left off rather
than starting from the beginning.

-f reads the names of tests from the file given as f's argument, one
or more test names per line.  Whitespace is ignored.  Blank lines and
lines beginning with '#' are ignored.  This is especially useful for
whittling down failures involving interactions among tests.

-L causes the leaks(1) command to be run just before exit if it exists.
leaks(1) is available on Mac OS X and presumably on some other
FreeBSD-derived systems.

-R runs each test several times and examines sys.gettotalrefcount() to
see if the test appears to be leaking references.  The argument should
be of the form stab:run:fname where 'stab' is the number of times the
test is run to let gettotalrefcount settle down, 'run' is the number
of times further it is run and 'fname' is the name of the file the
reports are written to.  These parameters all have defaults (5, 4 and
"reflog.txt" respectively), and the minimal invocation is '-R :'.

-M runs tests that require an exorbitant amount of memory. These tests
typically try to ascertain containers keep working when containing more than
2 billion objects, which only works on 64-bit systems. There are also some
tests that try to exhaust the address space of the process, which only makes
sense on 32-bit systems with at least 2Gb of memory. The passed-in memlimit,
which is a string in the form of '2.5Gb', determines howmuch memory the
tests will limit themselves to (but they may go slightly over.) The number
shouldn't be more memory than the machine has (including swap memory). You
should also keep in mind that swap memory is generally much, much slower
than RAM, and setting memlimit to all available RAM or higher will heavily
tax the machine. On the other hand, it is no use running these tests with a
limit of less than 2.5Gb, and many require more than 20Gb. Tests that expect
to use more than memlimit memory will be skipped. The big-memory tests
generally run very, very long.

-u is used to specify which special resource intensive tests to run,
such as those requiring large file support or network connectivity.
The argument is a comma-separated list of words indicating the
resources to test.  Currently only the following are defined:

    all -       Enable all special resources.

    none -      Disable all special resources (this is the default).

    audio -     Tests that use the audio device.  (There are known
                cases of broken audio drivers that can crash Python or
                even the Linux kernel.)

    curses -    Tests that use curses and will modify the terminal's
                state and output modes.

    largefile - It is okay to run some test that may create huge
                files.  These tests can take a long time and may
                consume >2GB of disk space temporarily.

    network -   It is okay to run tests that use external network
                resource, e.g. testing SSL support for sockets.

    decimal -   Test the decimal module against a large suite that
                verifies compliance with standards.

    cpu -       Used for certain CPU-heavy tests.

    subprocess  Run all tests for the subprocess module.

    urlfetch -  It is okay to download files required on testing.

    gui -       Run tests that require a running GUI.

To enable all resources except one, use '-uall,-<resource>'.  For
example, to run all the tests except for the gui tests, give the
option '-uall,-gui'.
�N)�
isabstract�__path__cCs"g|]}tjj|��qS�)�os�path�abspath)�.0rrr�#/usr/lib/python3.5/test/regrtest.py�
<listcomp>�s	r
�__file__�darwinii�����)�supportZaudioZcursesZ	largefileZnetworkZdecimalZcpu�
subprocessZurlfetchZguiZsrcdirZbuildcs"eZdZ�fdd�Z�S)�
_ArgParsercst�j|d�dS)Nz%
Pass -h or --help for complete help.)�super�error)�self�message)�	__class__rr	r�sz_ArgParser.error)�__name__�
__module__�__qualname__rrr)rr	r�src
Cs�tdddtdtdtdddtj�}d	}|jd
�}|jddd
ddd�|jddddtdd�|jdd
ddd�|jddd�|jdddddd|�|jd�}|jdd d
d!dd"�|jd#d$d
ddd%�|jd&d'd
ddd(�|jd)d*d
ddd+�|jd,d-d
dd.d/dd0�|jd1d
ddd2�|jd3�}|jd4d5d
ddd6|�|jd7dd8d.d9dt	dd:�|jd;d<dd=dd>|�|jd?d@d
dddA�|jdBdCd
dddD|�|jdEdFddGd.dHddI�|jdJdKd
dddL�|jdMdNddOd
dPdt
ddQ|�|jdRdSddTddU|�|jdVddWdtddX�|jdY�}|jdZd[d
ddd\�|jd]d^d
ddd_|�|jd`daddbdtddc|�|jdddeddfd.dgdt	ddh�|jdidjd
dd.dkddl�|jdmdnddWdtddo�|jdpdqd
drdsdd.dtddu�|jdvdwddxdt	ddy�|jdzd{d
ddd|�|jd}d~d
ddd�|jd�d�d.d�d
ddd��|jd�d�tj
dtj�|S)�N�progzregrtest.pyZusageZdescriptionZepilogZadd_helpFZformatter_classz-  See the section at bottom for more details.zGeneral optionsz-hz--help�action�helpzshow this help message and exitz	--timeout�metavarZTIMEOUT�typezxdump the traceback and exit if a test takes more than TIMEOUT seconds; disabled if TIMEOUT is negative or equals to zeroz--wait�
store_truez:wait for user input, e.g., allow a debugger to be attachedz--slaveargsZARGSz-Sz--startZSTARTz'the name of the test at which to start.Z	Verbosityz-vz	--verbose�countz/run tests in verbose mode with output to stdoutz-wz
--verbose2z#re-run failed tests in verbose modez-Wz
--verbose3zdisplay test output on failurez-qz--quietz'no output unless one or more tests failz-oz--slow�dest�
print_slowzprint the slowest 10 testsz--headerz"print header with interpreter infozSelecting testsz-rz--randomizezrandomize test execution order.z
--randseedZSEED�random_seedz5pass a random seed to reproduce a previous random runz-fz
--fromfileZFILEz'read names of tests to run from a file.z-xz	--excludez arguments are tests to *exclude*z-sz--singlez#single step through a set of tests.z-mz--matchZPAT�match_testsz2match test cases and methods with glob pattern PATz-Gz
--failfastz1fail as soon as a test fails (only with -v or -W)z-uz--usez
RES1,RES2,...�appendz6specify which special resource intensive tests to run.z-Mz
--memlimitZLIMITz&run very large memory-consuming tests.z	--testdirZDIRzWexecute test files in the specified directory (instead of the Python stdlib test suite)zSpecial runsz-lz--findleaksz0if GC is available detect tests that leak memoryz-Lz
--runleaksz*run the leaks(1) command just before exit.z-Rz--huntrleaksZ	RUNCOUNTSz:search for reference leaks (needs debug build, very slow).z-jz--multiprocessZ	PROCESSES�use_mpzrun PROCESSES processes at oncez-Tz
--coverage�tracez4turn on code coverage tracing using the trace modulez-Dz
--coverdirz&directory where coverage files are putz-Nz--nocoverdirZstore_constZconst�coverdirz$put coverage files alongside modulesz-tz--thresholdZ	THRESHOLDz call gc.set_threshold(THRESHOLD)z-nz--nowindowsz'suppress error message boxes on Windowsz-Fz	--foreverz9run the specified tests in a loop, until an error happensz-Pz--pgo�pgoz+enable Profile Guided Optimization training�args�nargs)r�USAGE�DESCRIPTION�EPILOG�argparseZRawDescriptionHelpFormatterZadd_argument_group�add_argument�float�int�resources_list�relative_filename�
huntrleaksZ	REMAINDERZSUPPRESS)�parserZmore_details�grouprrr	�_create_parser�s�
r;cCstjjtj|�S)N)rr�joinr�SAVEDCWD)�stringrrr	r7Msr7cCs�|jd�}t|�d
kr0tjd��|drJt|d�nd}|drjt|d�nd}t|�dkr�|dr�|dnd	}|||fS)N�:rrz&needs 2 or 3 colon-separated argumentsrrr
rz
reflog.txt)rr)�split�lenr2�ArgumentTypeErrorr5)r>r-�nwarmup�ntracked�fnamerrr	r8Rs	  ,r8cCs�dd�|jd�D�}xh|D]`}|dks#|dkrDq#|ddkrd|dd�}|tkr#tjd	|��q#W|S)
NcSsg|]}|j��qSr)�lower)r�xrrr	r
]s	z"resources_list.<locals>.<listcomp>�,�all�noner�-r
zinvalid resource: )r@�RESOURCE_NAMESr2rB)r>�u�rrrr	r6\s
r6c	/Ksitjddddddddddddd	dd
dddddd
ddddddddddddddddddddddddd�}xI|j�D];\}}t||�s�td|��t|||�q�W|jdkr�g|_t�}|jd|d|�|j	r8|j
r8|jd�|jrW|j
rW|jd�|jrv|jrv|jd �|jr�|jr�|jd!�|jr�|jp�|jr�|jd"�|jr�d|_|jdk	rttd#�r	|jdkrd|_ntd$�d|_|jdk	rk|jdkrSd%tj�pLd&|_|jd&krkd|_|jrMx�|jD]�}x�|D]�}|d'kr�t|jdd�<q�|d(kr�|jdd�=q�d}|dd)kr�d*}|d&d�}|r&||jkrE|jj|�q�||jkr�|jj|�q�Wq~W|jdk	red*|_|S)+N�testdir�verboser�quietF�exclude�single�	randomize�fromfile�	findleaks�
use_resourcesr*r+Zcoverage�runleaksr8�verbose2r%r&r)�verbose3�forever�header�failfastr'r,z3%r is an invalid keyword argument for this functionr-�	namespacez-s and -f don't go together!z-T and -j don't go together!z-l and -j don't go together!z-M and -j don't go together!z#-G/--failfast needs either -v or -W�dump_traceback_laterzFWarning: The timeout option requires faulthandler.dump_traceback_laterrr
rIrJrKT)r2Z	Namespace�items�hasattr�	TypeError�setattrrWr;�
parse_argsrSrUrr)r*rV�memlimitr]rPrZrQ�timeout�faulthandler�printr�	cpu_countZuserL�remover(r&rT)	r-�kwargs�ns�k�vr9�arNrjrrr	�_parse_argsgsv
		




		
			
	rpc
Cs#ddlm}m}tjgtj�ddddg}|jrR|dg}||j|j	ft
d|jd	|jd
|j
d|jd|jd
|jd|j�f}||dtj|�gd|d|dddtjdkdtj�}|j�\}}|j�}	|	||fS)a%Run the given test in a subprocess with --slaveargs.

    ns is the option Namespace parsed from command-line arguments. regrtest
    is invoked in a subprocess with the --slaveargs argument; when the
    subprocess exits, its return code, stdout and stderr are returned as a
    3-tuple.
    r)�Popen�PIPEz-Xrgz-mz
test.regrtestz--pgor8rW�output_on_failurerfr]r'r,z--slaveargs�stdout�stderrZuniversal_newlinesTZ	close_fds�nt�cwd)rrqrr�sys�
executablerZargs_from_interpreter_flagsr,rPrQ�dictr8rWrZrfr]r'�json�dumpsr�namer=Zcommunicate�wait)
�testnamerlrqrrZbase_cmd�	slaveargs�popenrtru�retcoderrr	�run_test_in_subprocess�s&	
		r�c.js�tjdd�g}ttd�r5|jtj�ttd�rT|jtj�x!|D]}tj|dd�q[Wt�t	j
tj�t
tjdd�|���jr�t��jdk	r�t	j�j��jdk	rddl}|j�j��jrtd	�yddl}Wntk
r<Yn�X|j|j|jB|jB|jB�y|jWnt k
r�YnuXxq|j!|j"|j#gD]W}�j$r��j$d
kr�|j||j%�|j&||j'�q�|j|d�q�W�j(r	t)d��j*dk	r�t+j,�j*�\}}|j-d�rKd
t.j/_0yt1||�}Wn^t2k
r~t3df}YnAt4k
r�}	z!t5j6�t7t8|	�f}WYdd}	~	XnXtjj9�t�tt+j:|��tj;d�g�g�g�	g�g�d
}
�j<r^yddl}Wn%tk
rWtd�d
�_<YnXg}�jrsd
t.j/_0�j=r�t>j?j@tAd�}y8tB|d��"}
|
jC�jD�}|g}WdQRXWntEk
r�YnX�jFr}g}tBt>j?j@t	jG�jF���l}
tHjId�}xS|
D]K}|jJd|�}|jK�}|r'|djLd�r'|jM|�q'WWdQRXtN�jO�tN|�tPdd�}tQjR�}�jSr�x7�jOD],}||kr�|jT|�|jU|�q�Wg�_O�j$s9�jVs9�jWp5�jXp5�j=p5|p5�jOr�tdtYjZ�tj[jK��tdtYjYdd�dtj\�tddtj]j^tj_dWkr�dnd�tdt>j`��tdtja��jbr�tc�jbtd�te��}ntc�jb||�}|p�jOp|}�j=rp|dd�}y||jf|d�d}Wntgk
rod}YnX�jhr�y|d|jf�jh��=Wn#tik
r�td�jh�YnX�jjr�jkdkr�tljmd��_ktljn�jk�td�jk�tljo|��jprgddlp}ddlq}|jrd tjstjt|ju�gd!d
d"d�}g�
�j$t	_$�jvt	_vtjwjx�}�����	�
fd#d$�}�jyr�td|��fd%d&�}|�}d}d'}n1tz|�}d(j{t||��}t||�d}�j}r�
ydd)l~m�Wn)tk
rjtd*�tj;d
�YnXdd+l�m�} tHjId,��| ��t�|������fd-d.����fd/d0�t��j}�D�}!x|!D]}"|"jh�q�Wd}#d}$y>x7|#�j}krB
�j-�\}%}&}'}|%dkrL	|#d7}#q	||%|��jXs�	�r{	�jWr{	d1}(nd2}(t|(j{||$|t|��|%��|&r�	t|&�|'r�	�jWr�	t|'d3tj��tjj9�tj�j9�|dt3kr	
t2�|dt7kr5
t�d4j{|%|d���|$d7}$q	WWn!t2k
rg
d}
d�_�YnXx�|!D]}"|"j@�qo
Wn�x�t�|d�D]�\}$}%�jXs�
�r�
�jWr�
d1}(nd2}(t|(j{||$|t|��|%��tjj9��jpr'|j�d5d6t��d7t���nxy\t1|%�j$�jX�jd8�j�d9�j�d:�j�d;�j�d<�jW�}||%|�Wnt2k
r�d}
PYnX�j<r|j��|j�rtd=t||j��d>d?�td@�|jM|j��|j�dd�=x?tjwjx�D].})|)|kr|)jLdA�rt	j�|)�qWq�
W|
r��jWr�t�tdB�te|�te��te��te�	�}*tt�t||*�dC�dD�t�|*��r%
�jXr%
�jWr%
�r	
�	r	
|
r	
t|��dkr	
tdEd>d?�tt�t|��dC�dF��j�r}
�
j�dGd�tdH�x2�
ddI�D] \}+}%tdJ|%|+f�qY
W�r�
�jWr�
tt�t|��dC�dK�t����r�
�jWr�
tdLj{t�t|��dC���t����	r/�jXr/�jWr/tt�t|�	�dC�dM�t��	��j�r3�r3tdN�x��dd�D]�}%�jWsvtdO|%�tjj9�y:d�_$t1|%d�jX�jd9�j�d<�jW�},Wnt2k
r�t�PYqYX|,dt�t�t�t�hkrY�jT|%�qYW�r3tt�t|��dC�dP�t����j=r||rotB|dQ��}
|
j�|dR�WdQRXn
t>j�|��jpr�|j��}-|-j�dSddTddU�j���j�r�t>j�dVt>j���tj;t|��dkp�|
�dS)XalExecute a test suite.

    This also parses command-line options and modifies its behavior
    accordingly.

    tests -- a list of strings containing test names (optional)
    testdir -- the directory in which to look for tests (optional)

    Users other than the Python test suite will certainly want to
    specify testdir; if it's omitted, the directory containing the
    Python test suite is searched for.

    If the tests argument is omitted, the tests listed on the
    command-line will be used.  If that's empty, too, then all *.py
    files beginning with test_ will be used.

    The other default arguments (verbose, quiet, exclude,
    single, randomize, findleaks, use_resources, trace, coverdir,
    print_slow, and random_seed) allow programmers calling main()
    directly to set the values that would normally be set by flags
    on the command line.
    Zall_threadsT�SIGALRM�SIGUSR1�chainr
NrzSThe --nowindows (-n) option is deprecated. Use -vv to display assertions in stderr.rzPress any key to continue...r8F�z%No GC available, disabling findleaks.Z
pynexttestrNz\[\s*\d+/\s*\d+\]�#z==z==  Zaliasedz	%s-endianzhash algorithm:� Z64bitZ32bitzTesting with flags:z1Couldn't find starting test (%s), using all testsi���zUsing random seedZ
ignoredirsr*r#cs�|\}}|ttfkr1�j||f�|tkrM�j|�nz|tkri�j|�n^|tkr��j|�nB|tkr��j|�n&|tkr��j|��j|�dS)N)�CHILD_ERROR�INTERRUPTEDr(�PASSED�FAILED�ENV_CHANGED�SKIPPED�RESOURCE_DENIED)�test�result�ok�	test_time)�bad�environment_changed�good�resource_denieds�skipped�
test_timesrr	�accumulate_result�s
zmain.<locals>.accumulate_resultc3s+x$x|D]}|V�r
dSq
WqWdS)Nr)�testsr�)r�rr	�test_forever�s

zmain.<locals>.test_foreverrz/{})�Threadz+Multiprocess option requires thread support)�Queuez\[\d+ refs, \d+ blocks\]$csByxyt��}Wn#tk
r;�jd�dSYnXt|��\}}}�jd|�}|j�jd�\}}}|dkr�td|f}�j||j�|j�|f�dS|s��jd�dSt	j
|�}�j||j�|j�|f�qWWn"tk
r=�jd��YnXdS)Nr��
rzExit code %s)NNNN)NNNN)NNNN)�next�
StopIterationZputr��sub�strip�
rpartitionr��rstripr{�loads�
BaseException)r�r�rtru�_r�)�debug_output_patrl�output�pendingrr	�work�s,

	%
-

zmain.<locals>.workcsg|]}�d���qS)�targetr)r�i)r�r�rr	r
�s	zmain.<locals>.<listcomp>z[{1:{0}}{2}/{3}] {4}z[{1:{0}}{2}] {4}�filezChild error on {}: {}z7runtest(test, ns.verbose, ns.quiet, timeout=ns.timeout)�globals�localsrsrfr]r'r,zWarning: test created�end� zuncollectable object(s).ztest.z(Test suite interrupted by signal SIGINT.r�zomitted:ZAllzOK.�reversez10 slowest tests:�
z	%s: %.1fszfailed:z%{} altered the execution environment:zskipped:z'Re-running failed tests in verbose modez"Re-running test %r in verbose modez
failed again:�wr�Zshow_missingZsummaryr+zleaks %dl)�rg�enablera�signalr(r�r��register�replace_stdoutrZrecord_original_stdoutrxrtrp�argvr8�warm_cachesreZset_memlimitZ	threshold�gcZ
set_thresholdZ	nowindowsrh�msvcrt�ImportErrorZSetErrorModeZSEM_FAILCRITICALERRORSZSEM_NOALIGNMENTFAULTEXCEPTZSEM_NOGPFAULTERRORBOXZSEM_NOOPENFILEERRORBOXZCrtSetReportMode�AttributeErrorZCRT_WARNZ	CRT_ERRORZ
CRT_ASSERTrPZCRTDBG_MODE_FILEZCrtSetReportFileZCRTDBG_FILE_STDERRr~�inputr�r{r��get�unittestZ
BaseTestSuite�_cleanup�runtest�KeyboardInterruptr�r��	traceback�	print_excr��str�flushr|�exitrVrSrrr<�TEMPDIR�open�readr��OSErrorrUr=�re�compiler�r@�
startswith�extend�removepyr-�STDTESTS�NOTTESTS�copyrRrj�addr\r,rQ�platformZpython_implementation�version�	byteorder�	hash_info�	algorithm�maxsize�getcwd�flagsrO�	findtests�list�set�index�
IndexError�start�
ValueErrorrTr&�randomZ	randrangeZseedZshuffler*�tempfileZTrace�base_prefix�base_exec_prefix�
gettempdirrW�modules�keysr[�iter�formatrAr)�	threadingr�Zqueuer��MultiprocessTests�rangeru�	Exception�interrupted�	enumerateZrunctxr��varsrZrfr]r'�collectZgarbage�unloadr#�	printlistr%�sortrYr�r�r�r��write�unlinkZresultsZ
write_resultsr+rX�system�getpid).r�rkZsignalsZsignumr�r��mr-r��er�Z
found_garbage�filename�fpZ	next_testZ	count_pat�lineZguts�stdtests�nottests�argZalltestsZselectedZnext_single_testr*r�ZtracerZsave_modulesr�r�Z
test_countZtest_count_widthr�ZworkersZworkerZfinishedZ
test_indexr�rtruZfmt�moduleZomitted�timer�rNr)r�r�r�r�r�rlr�r�r�r�r�r�r	�main�s$
		


	


%

	

		
	$


	
	+		
	
	
	!				

	%


				




			
			
	
	

*
'	

	


	
	

	
		rZtest_grammarZtest_opcodesZ	test_dictZtest_builtinZtest_exceptionsZ
test_typesZ
test_unittestZtest_doctestZ
test_doctest2Ztest_supportc	Cs�t|�}tj|�}g}t|�|B}xa|D]Y}tjj|�\}}|dd�dkr8|dkr8||kr8|j|�q8W|t|�S)z-Return a list of all applicable test modules.NrZtest_�.pyr�)rr�)�findtestdirr�listdirr�r�splitextr(�sorted)	rOrr�namesr�Zothersr}�mod�extrrr	r�ws
.r�c@s:eZdZdZdd�Zdd�Zdd�ZdS)	r�z8A thread-safe iterator over tests for multiprocess mode.cCs%d|_tj�|_||_dS)NF)r�r�ZLock�lockr�)rr�rrr	�__init__�s	zMultiprocessTests.__init__cCs|S)Nr)rrrr	�__iter__�szMultiprocessTests.__iter__c	Cs7|j�'|jrtd��t|j�SWdQRXdS)Nztests interrupted)rr�r�r�r�)rrrr	�__next__�s
	zMultiprocessTests.__next__N)rrr�__doc__rrrrrrr	r��sr�cskddl}tj�t�j�dd�jddddd	d
�t_�fdd�}|j|�dS)
z�Set stdout encoder error handler to backslashreplace (as stderr error
    handler) to avoid UnicodeEncodeError when printing a tracebackrNr��encoding�errors�backslashreplace�closefdF�newliner�cstjj��t_dS)N)rxrt�closer)rtrr	�restore_stdout�s
z&replace_stdout.<locals>.restore_stdout)�atexitrxrtr��filenorr�)r rr)rtr	r��s		r�Fr,c	Cs�|dk	r|t_|dk	}
|
r:tj|dd�z=|t_|rUdt_|rGdt_tjdkr�t	j
�}|t_n tj}|jd�|j�t
j}t
j}
zq|t
_|t
_t||||ddd|	�}|dtkr-|	r-|j�}|
j|�|
j�Wd|t
_|
t
_Xn+|t_t||||d|d|	�}|SWd|
r�tj�t||�XdS)a}Run a single test.

    test -- the name of the test
    verbose -- if true, print more messages
    quiet -- if true, don't print 'skipped' messages (probably redundant)
    huntrleaks -- run multiple times to test for leaks; requires a debug
                  build; a triple corresponding to -R's three arguments
    use_resources -- list of extra resources to use
    output_on_failure -- if true, display test output on failure
    timeout -- dump the traceback and exit if a test takes more than
               timeout seconds
    failfast, match_tests -- See regrtest command-line flags for these.
    pgo -- if true, do not print unnecessary info when running the test
           for Profile Guided Optimization build

    Returns the tuple result, test_time, where result is one of the constants:
        INTERRUPTED      KeyboardInterrupt when run under -j
        RESOURCE_DENIED  test skipped because resource denied
        SKIPPED          test skipped for some other reason
        ENV_CHANGED      test failed because it changed the execution environment
        FAILED           test failed
        PASSED           test passed
    Nr�Tr�display_failureFr,)rrWrgr_r'r]rPr��stringio�io�StringIO�seek�truncaterxrtru�
runtest_innerr��getvaluer�r�Zcancel_dump_traceback_later�cleanup_test_droppings)r�rPrQr8rWrsr]r'rfr,Zuse_timeout�streamZorig_stdoutZorig_stderrr�r�rrr	r��sJ					

				
	
	
r�c@s�eZdZdZdZdddddd�Zd�Zdd �Zd!d"�Zd#d$�Z	d%d&�Z
d'd(�Zd)d*�Zd+d,�Z
d-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Zd=d>�Zd?d@�ZdAdB�ZdCdD�ZdEdF�ZdGdH�ZdIdJ�ZdKdL�ZdMdN�ZdOdP�ZdQdR�Z dSdT�Z!dUdV�Z"dWdX�Z#dYdZ�Z$d[d\�Z%d]d^�Z&d_d`�Z'dadb�Z(dcdd�Z)dedf�Z*dgdh�Z+didj�Z,dkdl�Z-dmdn�Z.dodp�Z/dqdr�Z0dsdt�Z1dudv�Z2dwdx�e3e4�D�Z5dydz�Z6d{d|�Z7d}d~�Z8dd��Z9d�d��Z:d�d��Z;d�d��Z<d�S)��saved_test_environmenta�Save bits of the test environment and restore them at block exit.

        with saved_test_environment(testname, verbose, quiet):
            #stuff

    Unless quiet is True, a warning is printed to stderr if any of
    the saved items was changed by the test.  The attribute 'changed'
    is initially False, but is set to True if a change is detected.

    If verbose is more than 1, the before and after state of changed
    items is also printed.
    Frr,cCs(||_||_||_||_dS)N)rrPrQr,)rrrPrQr,rrr	r
s			zsaved_test_environment.__init__�sys.argvrw�	sys.stdin�
sys.stdout�
sys.stderr�
os.environ�sys.path�sys.path_hooks�
__import__�warnings.filters�asyncore.socket_map�logging._handlers�logging._handlerList�sys.gettrace�sys.warnoptions�!multiprocessing.process._dangling�threading._dangling�sysconfig._CONFIG_VARS�sysconfig._INSTALL_SCHEMES�files�locale�warnings.showwarning�shutil_archive_formats�shutil_unpack_formatscCs&ttj�tjtjdd�fS)N)�idrxr�)rrrr	�get_sys_argv'sz#saved_test_environment.get_sys_argvcCs(|dt_|dtjdd�<dS)Nr
r)rxr�)rZ
saved_argvrrr	�restore_sys_argv)s
z'saved_test_environment.restore_sys_argvcCs
tj�S)N)rr�)rrrr	�get_cwd-szsaved_test_environment.get_cwdcCstj|�dS)N)r�chdir)rZ	saved_cwdrrr	�restore_cwd/sz"saved_test_environment.restore_cwdcCstjS)N)rxrt)rrrr	�get_sys_stdout2sz%saved_test_environment.get_sys_stdoutcCs
|t_dS)N)rxrt)rZsaved_stdoutrrr	�restore_sys_stdout4sz)saved_test_environment.restore_sys_stdoutcCstjS)N)rxru)rrrr	�get_sys_stderr7sz%saved_test_environment.get_sys_stderrcCs
|t_dS)N)rxru)rZsaved_stderrrrr	�restore_sys_stderr9sz)saved_test_environment.restore_sys_stderrcCstjS)N)rx�stdin)rrrr	�
get_sys_stdin<sz$saved_test_environment.get_sys_stdincCs
|t_dS)N)rxrN)rZsaved_stdinrrr	�restore_sys_stdin>sz(saved_test_environment.restore_sys_stdincCs"ttj�tjttj�fS)N)rDr�environrz)rrrr	�get_os_environAsz%saved_test_environment.get_os_environcCs2|dt_tjj�tjj|d�dS)Nr
r)rrQ�clear�update)rZ
saved_environrrr	�restore_os_environCs

z)saved_test_environment.restore_os_environcCs&ttj�tjtjdd�fS)N)rDrxr)rrrr	�get_sys_pathHsz#saved_test_environment.get_sys_pathcCs(|dt_|dtjdd�<dS)Nr
r)rxr)rZ
saved_pathrrr	�restore_sys_pathJs
z'saved_test_environment.restore_sys_pathcCs&ttj�tjtjdd�fS)N)rDrx�
path_hooks)rrrr	�get_sys_path_hooksNsz)saved_test_environment.get_sys_path_hookscCs(|dt_|dtjdd�<dS)Nr
r)rxrX)rZsaved_hooksrrr	�restore_sys_path_hooksPs
z-saved_test_environment.restore_sys_path_hookscCs
tj�S)N)rx�gettrace)rrrr	�get_sys_gettraceTsz'saved_test_environment.get_sys_gettracecCstj|�dS)N)rx�settrace)rZ	trace_fxnrrr	�restore_sys_gettraceVsz+saved_test_environment.restore_sys_gettracecCstjS)N)�builtinsr4)rrrr	�get___import__Ysz%saved_test_environment.get___import__cCs
|t_dS)N)r_r4)r�import_rrr	�restore___import__[sz)saved_test_environment.restore___import__cCs&ttj�tjtjdd�fS)N)rD�warnings�filters)rrrr	�get_warnings_filters^sz+saved_test_environment.get_warnings_filterscCs(|dt_|dtjdd�<dS)Nr
r)rcrd)rZ
saved_filtersrrr	�restore_warnings_filters`s
z/saved_test_environment.restore_warnings_filterscCs+tjjd�}|r'|jj�p*iS)N�asyncore)rxr�r��
socket_mapr�)rrgrrr	�get_asyncore_socket_mapdsz.saved_test_environment.get_asyncore_socket_mapcCsBtjjd�}|dk	r>|jdd�|jj|�dS)NrgZ
ignore_allT)rxr�r�Z	close_allrhrT)rZ	saved_maprgrrr	�restore_asyncore_socket_maphsz2saved_test_environment.restore_asyncore_socket_mapcCstjtjj�fS)N)�shutil�_ARCHIVE_FORMATSr�)rrrr	�get_shutil_archive_formatsnsz1saved_test_environment.get_shutil_archive_formatscCs2|dt_tjj�tjj|d�dS)Nrr
)rkrlrSrT)r�savedrrr	�restore_shutil_archive_formatsss

z5saved_test_environment.restore_shutil_archive_formatscCstjtjj�fS)N)rk�_UNPACK_FORMATSr�)rrrr	�get_shutil_unpack_formatsxsz0saved_test_environment.get_shutil_unpack_formatscCs2|dt_tjj�tjj|d�dS)Nrr
)rkrprSrT)rrnrrr	�restore_shutil_unpack_formatszs

z4saved_test_environment.restore_shutil_unpack_formatscCs"ttj�tjtjj�fS)N)rD�loggingZ	_handlersr�)rrrr	�get_logging__handlerssz,saved_test_environment.get_logging__handlerscCsdS)Nr)rZsaved_handlersrrr	�restore_logging__handlers�sz0saved_test_environment.restore_logging__handlerscCs&ttj�tjtjdd�fS)N)rDrsZ_handlerList)rrrr	�get_logging__handlerList�sz/saved_test_environment.get_logging__handlerListcCsdS)Nr)rZsaved_handlerListrrr	�restore_logging__handlerList�sz3saved_test_environment.restore_logging__handlerListcCs&ttj�tjtjdd�fS)N)rDrx�warnoptions)rrrr	�get_sys_warnoptions�sz*saved_test_environment.get_sys_warnoptionscCs(|dt_|dtjdd�<dS)Nr
r)rxrx)rZ
saved_optionsrrr	�restore_sys_warnoptions�s
z.saved_test_environment.restore_sys_warnoptionscCsts
dStjj�S)N)r��	_danglingr�)rrrr	�get_threading__dangling�sz.saved_test_environment.get_threading__danglingcCs+ts
dStjj�tjj|�dS)N)r�r{rSrT)rrnrrr	�restore_threading__dangling�s
z2saved_test_environment.restore_threading__danglingcCs'ts
dStjj�tjjj�S)N)�multiprocessing�processr�r{r�)rrrr	�%get_multiprocessing_process__dangling�s
z<saved_test_environment.get_multiprocessing_process__danglingcCs1ts
dStjjj�tjjj|�dS)N)r~rr{rSrT)rrnrrr	�)restore_multiprocessing_process__dangling�sz@saved_test_environment.restore_multiprocessing_process__danglingcCs/tjd�ttj�tjttj�fS)N�prefix)�	sysconfig�get_config_varrD�_CONFIG_VARSrz)rrrr	�get_sysconfig__CONFIG_VARS�s
z1saved_test_environment.get_sysconfig__CONFIG_VARScCs2|dt_tjj�tjj|d�dS)Nr
r)r�r�rSrT)rrnrrr	�restore_sysconfig__CONFIG_VARS�s

z5saved_test_environment.restore_sysconfig__CONFIG_VARScCs"ttj�tjtjj�fS)N)rDr��_INSTALL_SCHEMESr�)rrrr	�get_sysconfig__INSTALL_SCHEMES�sz5saved_test_environment.get_sysconfig__INSTALL_SCHEMEScCs2|dt_tjj�tjj|d�dS)Nr
r)r�r�rSrT)rrnrrr	�"restore_sysconfig__INSTALL_SCHEMES�s

z9saved_test_environment.restore_sysconfig__INSTALL_SCHEMEScCstdd�tj�D��S)Ncss1|]'}|tjj|�r$dndVqdS)�/r�N)rr�isdir)r�fnrrr	�	<genexpr>�sz3saved_test_environment.get_files.<locals>.<genexpr>)rrr)rrrr	�	get_files�sz saved_test_environment.get_filescCsjtj}||krf|d|krftjj|�rGtj|�ntjj|�rftj|�dS)Nr�)r�TESTFNrr�isfiler�r��rmtree)rZsaved_valuer�rrr	�
restore_files�s	z$saved_test_environment.restore_filescCs.g|]$}|jd�rtt|��qS)ZLC_)r��getattrr@)r�lcrrr	r
�s	z!saved_test_environment.<listcomp>c
Cs_g}xR|jD]G}y#|j|tj|d�f�Wqttfk
rVwYqXqW|S)N)�_lcr(r@�	setlocalerbr�)rZpairingsr�rrr	�
get_locale�s#z!saved_test_environment.get_localecCs+x$|D]\}}tj||�qWdS)N)r@r�)rrnr�Zsettingrrr	�restore_locale�sz%saved_test_environment.restore_localecCstjS)N)rc�showwarning)rrrr	�get_warnings_showwarning�sz/saved_test_environment.get_warnings_showwarningcCs
|t_dS)N)rcr�)r�fxnrrr	�restore_warnings_showwarning�sz3saved_test_environment.restore_warnings_showwarningccs^xW|jD]L}|jdd�}d|}d|}|t||�t||�fVq
WdS)N�.r�Zget_Zrestore_)�	resources�replacer�)rr}Z
method_suffixZget_nameZrestore_namerrr	�
resource_info�s


z$saved_test_environment.resource_infocCs&tdd�|j�D��|_|S)Ncss'|]\}}}||�fVqdS)Nr)rr}r��restorerrr	r��sz3saved_test_environment.__enter__.<locals>.<genexpr>)rzr��saved_values)rrrr	�	__enter__�sz saved_test_environment.__enter__c
Cs�|j}|`x�|j�D]�\}}}|�}|j|�}	||	krd|_||	�|jr|jrtdj||j�dt	j
�|jdkr|jrtdj|	|�dt	j
�qWdS)NTz Warning -- {} was modified by {}r�r
z  Before: {}
  After:  {} F)r�r��pop�changedrQr,rhr�rrxrurP)
r�exc_typeZexc_valZexc_tbr�r}r�r�ZcurrentZoriginalrrr	�__exit__�s"			
	
	zsaved_test_environment.__exit__N)r-zcwdr.r/r0r1r2r3z
__import__r5r6r7r8r9r:r;r<r=r>r?zlocalerArBrC)=rrrrr�rr�rErFrGrIrJrKrLrMrOrPrRrUrVrWrYrZr\r^r`rbrerfrirjrmrorqrrrtrurvrwryrzr|r}r�r�r�r�r�r�r�r��dirr@r�r�r�r�r�r�r�r�rrrr	r,�s�r,Tc
s�tj|�d}d}y�|jd�r4|}n
d|}t|||d|���}	tj�}
tj|��t�dd�}|dkr��fdd�}|�|r�t�|||�}tj�|
}WdQRXWn�tj	k
r=}z:|r!|r!t
|d|�tjj
�t|fSWYdd}~Xnltjk
r�}z:|r}|r}t
|d|�tjj
�t|fSWYdd}~Xntk
r��Yn�tjk
r/}z`|s|r�t
d	|d
|dtj�nt
d	|ddtj�tjj
�t|fSWYdd}~Xnztj�}|s`t
d	|d
|dtj�tjj
�t|fSYn.X|r�t|fS|	jr�t|fSt|fSdS)NgFztest.r,Z	test_maincshtj�}|j��}x$|jD]}t|dtj�q%W|jrWtd��tj	|�dS)Nr�zerrors while loading tests)
r�Z
TestLoaderZloadTestsFromModulerrhrxrur�rZrun_unittest)�loaderr�r)�
the_modulerr	�test_runners	z"runtest_inner.<locals>.test_runnerz
skipped --r�z	failed --r��failedz
crashed --)rr�r�r,r
�	importlib�
import_moduler��dash_RZResourceDeniedrhrxrtr�r�r�ZSkipTestr�r�Z
TestFailedrur�r��
format_excr�r�r�)
r�rPrQr8r"r,r�ZrefleakZabstestZenvironmentZ
start_timer��msgr)r�r	r(�s^
	






	
r(c	Csaddl}ddl}ddl}|j�x,tjdfD]}tjj|�sYq>tjj	|�r~d|j
}}n5tjj|�r�dtj}}nt
d|��|r�td|||f�y>ttd�rtj||j|jB|jB�||�Wq>tk
rX}z(td||||fdtj�WYdd}~Xq>Xq>WdS)	NrZdb_homeZ	directoryr�z8os.path says %r exists but is neither directory nor filez%r left behind %s %r�chmodz3%r left behind %s %r and it couldn't be removed: %s)rk�statr�r�rr�rr�existsr�r�r�r��SystemErrorrhrar��S_IRWXU�S_IRWXG�S_IRWXOr�rxru)	rrPrkr�r�r}ZkindZnukerr�rrr	r*?s.
	

!r*c s%ddl}ddl�ttd�s3td��tjdd�}|jj�}tj	j�}yddl
}Wntk
r�d}	YnX|jj�}	i}
xg�fdd��j
jD�D]F}t|�s�q�x.|j�|gD]}|jj�|
|<q�Wq�W|\}
}}tjjtj|�}|
|}dg|}dg|}td|dd	tj�td
|ddd|�d	tj�tjj�x�t|�D]}}|�t||||	|
�\}}tjjd
�tjj�||
kr%||||<||||<||}}q�Wtd	tj�dd�}dd�}d}x�|d|f|d|fgD]�\}}}||�r�d|||
d�|t|�f}t|d	tj�tjj�t|d��!}t|d	|�|j�WdQRXd}q�W|S)z�Run a test multiple times, looking for reference leaks.

    Returns:
        False if the test didn't leak references; True if we detected refleaks.
    rN�gettotalrefcountz9Tracking reference leaks requires a debug build of Pythoncs"g|]}t�j|��qSr)r��abc)rro)�collectionsrr	r
�s	zdash_R.<locals>.<listcomp>Z	beginningZrepetitionsr�Z
1234567890r�r
r�cSs
t|�S)N)�any)�deltasrrr	�check_rc_deltas�szdash_R.<locals>.check_rc_deltascSsFd|jd�t|�kr#dSt|�dddhksBdSdS)NrrTr
F���)r#rAr�)r�rrr	�check_alloc_deltas�s
z"dash_R.<locals>.check_alloc_deltasFZ
referencesz
memory blocksz%s leaked %s %s, sum=%sroT)�copyreg�collections.abcrarxr�rcrd�dispatch_tabler��path_importer_cache�	zipimportr��_zip_directory_cacher��__all__r�__subclasses__�
_abc_registryrrr<rr=rhrur�r��dash_R_cleanupr��sumr�) r�r�Z
indirect_testr8r��fs�ps�picr��zdc�abcsr��objrCrDrEZrepcountZ	rc_deltasZalloc_deltasr�Zalloc_afterZrc_afterZ	rc_beforeZalloc_beforer�r�r�r�Z	item_nameZcheckerr�Zrefrepr)r�r	r�ish
&


)

#

r�csddl}ddl}ddl}ddl}ddl}	ddl}	ddl}
ddl}ddl}ddl	}
ddl
�ddlm}ddl
m}x,tjj�D]}t|d�r�|`q�W|tjdd�<|jj�|jj|�tjj�tjj|�yddl}Wntk
rDYnX|jj�|jj|�tj�x��fdd��jjD�D]k}t |�s�q�xS|j!�|gD]>}|j"||��j#�|_$|j%j�|j&j�q�Wq�Wx<tj'tj(tj)tj*fD]}|dk	r|j+�qW|j�t,j-�|j.j�|	j/j0�|	j1j2�|j3�|
j4�|
j5j�|j6�d|_7yddl8}Wntk
r�YnX|j9�tj:}tj;}|j<�|�|�fS)Nr)�
_path_created)�WeakSet�__warningregistry__cs"g|]}t�j|��qSr)r�r�)rro)r�rr	r
�s	z"dash_R_cleanup.<locals>.<listcomp>)=r�r��	_strptime�	linecacheZurllib.parseZurllib.request�	mimetypes�doctest�struct�filecmpr�Zdistutils.dir_utilr��weakrefr�rxr��valuesrar�rcrdr�rSrTr�r�r�r��_clear_type_cacher�r�rr�r�r�r��
_abc_cache�_abc_negative_cachertru�
__stdout__�
__stderr__r�r��purgeZ_regex_cache�parseZclear_cacheZrequestZ
urlcleanup�
clearcacheZ_default_mime_types�_cacheZ_clearcacheZmaster�ctypesZ_reset_cache�getallocatedblocksr�r�)r�r�r�r�r�r�r�r�r�Zurllibr�r�r�r�r�r�rr�r�r�r+r�Zfunc1Zfunc2r)r�r	r��sd0$





&
%








	

		
r�cCsmttd��}x&td�D]}|||d�qWdd�td�D�}ttdd��}dS)N�r
cSsg|]}t|��qSr)�chr)rr�rrr	r
s	zwarm_caches.<locals>.<listcomp>ri���)�bytesr�r�)�sr�rGrrr	r��s
r�cCs|ptjjt�ptjS)N)rr�dirnamer�curdir)rrrr	r
sr
cCsY|s
dSxHt|�D]:\}}tjj|�\}}|dkr|||<qWdS)Nz.py)r�rrr)r�idxr}�basenamerrrr	r�sr�cCs,|dkrd||fSd||fSdS)Nr
z%d %sz%d %ssr)�nZwordrrr	r#sr#�FcCsYddlm}d|}t|djdd�t|�D��|d|d|��dS)	z�Print the elements of iterable x to stdout.

    Optional arg width (default 70) is the maximum line length.
    Optional arg indent (default 4) is the number of blanks with which to
    begin each line.
    r)�fillr�css|]}t|�VqdS)N)r�)rZeltrrr	r�!szprintlist.<locals>.<genexpr>Zinitial_indentZsubsequent_indentN)Ztextwrapr�rhr<r)rG�width�indentr�Zblanksrrr	r�s
+r�cCs�tj�r2ytjt�Wntk
r1YnXdjtj��}tjj	t|�}t
j|dd��t�WdQRXdS)z,Run main() in a temporary working directory.ztest_python_{}rQTN)
r��is_python_buildr�mkdirr��FileExistsErrorr�rrr<rZtemp_cwdr)Ztest_cwdrrr	�main_in_temp_cwd%s
r��__main__)err/r0r1r�r2r_rgr$r{r@rsrr�r�r�rkr�rxr�r�r
r�r�rc�inspectrr�r�Z_multiprocessingZmultiprocessing.processr~r�r�r	rarrrrZresourceZ	getrlimitZRLIMIT_STACKZsoftZhard�min�maxZnewsoftZ	setrlimitr�r�r�r�r�r�r�r�rrLr�r<r�r�r��ArgumentParserrr;r7r8r6rpr�rr�r�r�r��objectr�r�r�r#r,r(r*r�r�r�r
r�r#r�r�r�normpathr�r�ZmydirrAr��AssertionErrorrrrr	�<module>s�
_


	
!s
F"��		
	F	
�?*LF
1
+%