HEX
Server: Apache
System: FreeBSD www860.sakura.ne.jp 13.0-RELEASE-p14 FreeBSD 13.0-RELEASE-p14 #2: Mon Dec 9 13:54:55 JST 2024 root@www5301.sakura.ne.jp:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64
User: yoyo0427 (1306)
PHP: 8.3.8
Disabled: NONE
Upload Files
File: //usr/local/lib/python2.7/test/test_threadedtempfile.pyo
�
N��ac@s�dZdZdZddlZddlmZmZmZed�Zddl	Z	ddl
Z
ddlmZej
�Zdejfd	��YZd
e	jfd��YZd�Zed
kr�e�ndS(sn
Create and delete FILES_PER_THREAD temp files (via tempfile.TemporaryFile)
in each of NUM_THREADS threads, recording the number of successes and
failures.  A failure is a bug in tempfile, and may be due to:

+ Trying to create more than one tempfile with the same name.
+ Trying to delete a tempfile that doesn't still exist.
+ Something we've never seen before.

By default, NUM_THREADS == 20 and FILES_PER_THREAD == 50.  This is enough to
create about 150 failures per run under Win98SE in 2.0, and runs pretty
quickly. Guido reports needing to boost FILES_PER_THREAD to 500 before
provoking a 2.0 failure under Linux.
ii2i����N(t
start_threadstrun_unittestt
import_modulet	threading(t	print_exctTempFileGreedycBseZdZdZd�ZRS(icCs�tj�|_tj�xitt�D][}ytjd�}|j�Wn&|j	d7_	t
d|j�q&X|jd7_q&WdS(Nsw+bitfile(tStringIOterrorst
startEventtwaittrangetFILES_PER_THREADttempfilet
TemporaryFiletcloseterror_countRtok_count(tselftitf((s6/usr/local/lib/python2.7/test/test_threadedtempfile.pytrun!s
(t__name__t
__module__RRR(((s6/usr/local/lib/python2.7/test/test_threadedtempfile.pyRstThreadedTempFileTestcBseZd�ZRS(cCs�gtt�D]}t�^q
}t|tj��WdQXtd�|D��}g|D]4}|jrXt|j	��t|j
j��^qX}dt|�|dj
|�f}|j|g|�|j|tt�dS(Ncss|]}|jVqdS(N(R(t.0tt((s6/usr/local/lib/python2.7/test/test_threadedtempfile.pys	<genexpr>4ssErrors: errors %d ok %d
%ss
(RtNUM_THREADSRRR	tsettsumRtstrtgetNameRtgetvaluetlentjointassertEqualR(RRtthreadstokRRtmsg((s6/usr/local/lib/python2.7/test/test_threadedtempfile.pyt	test_main0s">(RRR'(((s6/usr/local/lib/python2.7/test/test_threadedtempfile.pyR/scCstt�dS(N(RR(((s6/usr/local/lib/python2.7/test/test_threadedtempfile.pyR'=st__main__(t__doc__RRR
ttest.test_supportRRRRtunittestRt	tracebackRtEventR	tThreadRtTestCaseRR'R(((s6/usr/local/lib/python2.7/test/test_threadedtempfile.pyt<module>s