python (3.12.0)

(root)/
lib/
python3.12/
test/
__pycache__/
test_threadedtempfile.cpython-312.opt-1.pyc

ΑedZddlZddlmZddlZddlZddlZddlmZejddZ
dZejZ
Gd	d
ejZGddej Zed
k(rej&yy)an
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.
N)threading_helper)	print_excT)module2ceZdZdZdZdZy)TempFileGreedyrc`tj|_tj	ttD]=}	tjd}|j|xjdz
c_
?y#|xjdz
c_t|jYpxYw)Nzw+b)file)
ioStringIOerrors
startEventwaitrangeFILES_PER_THREADtempfile
TemporaryFilecloseok_counterror_countr)selfifs   N/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/test/test_threadedtempfile.pyrunzTempFileGreedy.run%skkm'(	#A
#**51	


"
	#
,  A% t{{+s%A>>-B-N)__name__
__module____qualname__rrrrr	r	!sKH#r"r	ceZdZdZy)ThreadedTempFileTestc<ttDcgc]}t}}tj|t
j5	dddtd|D}|Dcgc]G}|jr9t|jt|jjzI}}dt||dj|fz}|j|g||j|tt zycc}w#1swYxYwcc}w)Nc34K|]}|jyw)N)r).0ts  r	<genexpr>z1ThreadedTempFileTest.test_main.<locals>.<genexpr>8s--szErrors: errors %d ok %d
%s
)rNUM_THREADSr	r
start_threadsrsetsumrstrnamergetvaluelenjoinassertEqualr)rrthreadsokr(rmsgs       r	test_mainzThreadedTempFileTest.test_main4s-2;-?@>#@@

+
+GZ^^
D		
-W-
-"5ammaff+AHH$5$5$7 8855,s6{BIIf/S)[+;;<A		5sD	D
)AD
DN)rrr r8r!r"rr$r$3s=r"r$__main__)__doc__rtest.supportrunittestr
	threading	tracebackrrequires_working_threadingr+rEventrThreadr	TestCaser$rmainr!r"r<module>rDs
)	+++48Y__

#Y%%#$=8,,=zHMMOr"