CoolFace
Apppublic

Aluode/PerceptionLabPortable

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
test_testing.cpython-310.pyc20 linesDownload Raw Back to __pycache__
1o

2��Yi�	�@sLddlZddlZddlmZmZdd�Zdd�Zdd�Zd	d3�Zdd�Z	dS)
�N)�check_subprocess_call�raisescCs6d�gd��}ttjd|g�ttjd|gdd�dS)N�4)zresult = 1 + 2 * 3z
print(result)zmy_list = [1, 2, 3]zprint(my_list)�-cz7\s{1,2}\[1, 2, 3\]�Zstdout_regex)�joinr�sys�5executable)�code�r��E:\DocsHouse\542 percep lab latest\PerceptionLab\PerceptionLab_Portable\python_embed\Lib\site-packages\joblib/test/test_testing.py�test_check_subprocess_calls�67�r
cCsXd}d}tt��}ttjd|g|d�Wd�n1swY|�d�|��dS)NZ42Z_no_way_this_matches_anything_rrzUnexpected stdout.+{})r�8ValueErrorrrr	�match�format)r9Znon_matching_pattern�excinforrr�-test_check_subprocess_call_non_matching_regexs10��rcCs<d}tt��t|g�Wd�dS1swYdS)NZ_a_command_that_does_not_exist_)r�OSErrorr)Z
wrong_commandrrr�(test_check_subprocess_call_wrong_command!s11"�rcCsbd�gd��}t�dtj�}tt��}ttjd|g�Wd�n1s%wY|�	|�dS)Nr)�12import syszprint("writing on stdout")z%sys.stderr.write("writing on stderr")z
sys.exit(123)zONon-zero return code: 123.+Stdout:13writing on stdout.+Stderr:14writing on stderrr�15r�re�compile�DOTALLrrrrr	r)Zcode_with_non_zero_exit�patternrrrr�/test_check_subprocess_call_non_zero_return_code's�	�16�rcCsfd�gd��}t�dtj�}tt��}ttjd|gdd�Wd�n1s'wY|�	|�dS)Nr)	zimport timerzprint("before sleep on stdout")�sys.stdout.flush()z*sys.stderr.write("before sleep on stderr")zsys.stderr.flush()ztime.sleep(10)z-print("process should have be killed before")rzVNon-zero return code:.+Stdout:17before sleep on stdout\s+Stderr:18before sleep on stderrr�)�timeoutr)Zcode_timing_outrrrrr�"test_check_subprocess_call_timeout=s��19�r)20rrZjoblib.testingrrr
rrrrrrrr�<module>s
Aluode/PerceptionLabPortable · CoolFace