Your IP : 216.73.216.196


Current Path : /opt/alt/python37/lib64/python3.7/test/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/test/__pycache__/test_threadedtempfile.cpython-37.opt-2.pyc

B

YI~dv�@s�dZdZddlZddlmZmZddlZddlZddlZddl	m
Z
e��ZGdd�dej
�ZGdd	�d	ej�Zed
kr�e��dS)��2�N)�
start_threads�
import_module)�	print_excc@seZdZdZdZdd�ZdS)�TempFileGreedyrcCstt��|_t��x\tt�D]P}yt�d�}|�	�Wn&|j
d7_
t|jd�YqX|jd7_qWdS)Nzw+b�)�file)
�io�StringIO�errors�
startEvent�wait�range�FILES_PER_THREAD�tempfileZ
TemporaryFile�close�error_countr�ok_count)�self�i�f�r�?/opt/alt/python37/lib64/python3.7/test/test_threadedtempfile.py�run!s

zTempFileGreedy.runN)�__name__�
__module__�__qualname__rrrrrrrrsrc@seZdZdd�ZdS)�ThreadedTempFileTestc	Cs�dd�tt�D�}t|tj��WdQRXtdd�|D��}dd�|D�}dt|�|d�|�f}|�|g|�|�|tt	�dS)NcSsg|]
}t��qSr)r)�.0rrrr�
<listcomp>1sz2ThreadedTempFileTest.test_main.<locals>.<listcomp>css|]}|jVqdS)N)r)r�trrr�	<genexpr>4sz1ThreadedTempFileTest.test_main.<locals>.<genexpr>cSs*g|]"}|jrt|j�t|j����qSr)r�str�namer�getvalue)rr!rrrr 5szErrors: errors %d ok %d
%s�
)
r�NUM_THREADSrr
�set�sum�len�joinZassertEqualr)rZthreads�okr�msgrrr�	test_main0s

zThreadedTempFileTest.test_mainN)rrrr.rrrrr/sr�__main__)r'rrZtest.supportrrZunittestr
Z	threading�	tracebackrZEventr
ZThreadrZTestCaserr�mainrrrr�<module>s