Your IP : 216.73.216.85


Current Path : /opt/alt/python38/lib64/python3.8/test/__pycache__/
Upload File :
Current File : //opt/alt/python38/lib64/python3.8/test/__pycache__/test_threadedtempfile.cpython-38.opt-2.pyc

U

i�fj�@s�ddlZddlmZddlZddlZddlZddlmZdZdZ	e�
�ZGdd�dej�Z
Gdd	�d	ej�Zed
kr|e��dS)�N)�
start_threads)�	print_exc��2c@seZdZdZdZdd�ZdS)�TempFileGreedyrcCspt��|_t��tt�D]P}zt�d�}|�	�Wn&|j
d7_
t|jd�YqX|jd7_qdS)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/python38/lib64/python3.8/test/test_threadedtempfile.py�run$s

zTempFileGreedy.runN)�__name__�
__module__�__qualname__rrrrrrrr src@seZdZdd�ZdS)�ThreadedTempFileTestc	Cs�dd�tt�D�}t|tj��W5QRXtdd�|D��}dd�|D�}dt|�|d�|�f}|�|g|�|�|tt	�dS)NcSsg|]
}t��qSr)r)�.0rrrr�
<listcomp>4sz2ThreadedTempFileTest.test_main.<locals>.<listcomp>css|]}|jVqdS)N)r�r�trrr�	<genexpr>7sz1ThreadedTempFileTest.test_main.<locals>.<genexpr>cSs*g|]"}|jrt|j�t|j����qSr)r�str�namer�getvaluer rrrr8s�zErrors: errors %d ok %d
%s�
)
r�NUM_THREADSrr�set�sum�len�joinZassertEqualr)rZthreads�okr�msgrrr�	test_main3s
�
�zThreadedTempFileTest.test_mainN)rrrr.rrrrr2sr�__main__)rZtest.supportrZunittestr	Z	threading�	tracebackrr'rZEventrZThreadrZTestCaserr�mainrrrr�<module>s