Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /opt/cppython/lib/python3.8/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : //opt/cppython/lib/python3.8/test/__pycache__/test_threadedtempfile.cpython-38.opt-1.pyc
U

>��gj�@s�dZddlZddlmZddlZddlZddlZddlmZdZ	dZ
e��ZGdd�dej
�ZGd	d
�d
ej�Zedkr�e��dS)an
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.
�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�tempfile�
TemporaryFile�close�error_countr�ok_count)�self�i�f�r�9/opt/cppython/lib/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!rrrr 8s�zErrors: errors %d ok %d
%s�
)
r�NUM_THREADSrr�set�sum�len�joinZassertEqualr)r�threads�okr�msgrrr�	test_main3s
�
�zThreadedTempFileTest.test_mainN)rrrr0rrrrr2sr�__main__)�__doc__rZtest.supportrZunittestr	�	threading�	tracebackrr(r�Eventr�ThreadrZTestCaserr�mainrrrr�<module>s

F1le Man4ger