Current File : //opt/imh-python/lib/python2.7/test/test_threadedtempfile.pyc
�
��Wc@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((ss/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_threadedtempfile.pytrun!s
(t__name__t
__module__RRR(((ss/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/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((ss/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_threadedtempfile.pys	<genexpr>4ssErrors: errors %d ok %d
%ss
(RtNUM_THREADSRRR	tsettsumRtstrtgetNameRtgetvaluetlentjointassertEqualR(RRtthreadstokRRtmsg((ss/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_threadedtempfile.pyt	test_main0s">(RRR'(((ss/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_threadedtempfile.pyR/scCstt�dS(N(RR(((ss/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_threadedtempfile.pyR'=st__main__(t__doc__RRR
ttest.test_supportRRRRtunittestRt	tracebackRtEventR	tThreadRtTestCaseRR'R(((ss/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_threadedtempfile.pyt<module>s