Your IP : 216.73.217.32


Current Path : /opt/alt/python310/lib64/python3.10/test/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/test/__pycache__/test_threadedtempfile.cpython-310.opt-2.pyc

o

0�i~�@s�	ddlZddlmZddlZddlZddlZddlmZdZdZ	e�
�ZGdd�dej�Z
Gdd	�d	ej�Zed
krAe��dSdS)�N)�threading_helper)�	print_exc��2c@seZdZdZdZdd�ZdS)�TempFileGreedyrcCsnt��|_t��tt�D]'}zt�d�}|�	�Wn|j
d7_
t|jd�Yq
|jd7_q
dS)Nzw+b�)�file)
�io�StringIO�errors�
startEvent�wait�range�FILES_PER_THREAD�tempfileZ
TemporaryFile�close�error_countr�ok_count)�self�i�f�r�A/opt/alt/python310/lib64/python3.10/test/test_threadedtempfile.py�run$s

�zTempFileGreedy.runN)�__name__�
__module__�__qualname__rrrrrrrr src@seZdZdd�ZdS)�ThreadedTempFileTestcCs�dd�tt�D�}t�|tj��Wd�n1swYtdd�|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>7s�z1ThreadedTempFileTest.test_main.<locals>.<genexpr>cSs*g|]}|jrt|j�t|j����qSr)r�str�namer�getvaluer rrrr8s�zErrors: errors %d ok %d
%s�
)r�NUM_THREADSrZ
start_threadsr�set�sum�len�joinZassertEqualr)rZthreads�okr�msgrrr�	test_main3s��
�zThreadedTempFileTest.test_mainN)rrrr.rrrrr2sr�__main__)rZtest.supportrZunittestr	Z	threading�	tracebackrr'rZEventrZThreadrZTestCaserr�mainrrrr�<module>s�