Your IP : 216.73.216.213


Current Path : /opt/alt/python35/lib/python3.5/site-packages/joblib/test/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib/python3.5/site-packages/joblib/test/__pycache__/test_testing.cpython-35.pyc



-|�Wg
�@s~ddlZddlZddlmZddlmZmZdd�Zdd�Zdd	�Z	d
d�Z
dd
�ZdS)�N)�
assert_raises)�assert_raises_regex�check_subprocess_callcCsQdjddddg�}ttjd|g�ttjd|gdd�dS)	N�
zresult = 1 + 2 * 3z
print(result)zmy_list = [1, 2, 3]zprint(my_list)z-c�stdout_regexz7\s{1,2}\[1, 2, 3\])�joinr�sys�
executable)�code�r�I/opt/alt/python35/lib/python3.5/site-packages/joblib/test/test_testing.py�test_check_subprocess_call	s	r
cCs>d}d}ttdj|�ttjd|gd|�dS)NZ42Z_no_way_this_matches_anything_zUnexpected stdout.+{0}z-cr)r�
ValueError�formatrrr	)r
Znon_matching_patternrrr�-test_check_subprocess_call_non_matching_regexsrcCsd}ttt|g�dS)NZ_a_command_that_does_not_exist_)r�OSErrorr)Z
wrong_commandrrr�(test_check_subprocess_call_wrong_command!srcCsSdjddddg�}tjdtj�}tt|ttjd|g�dS)Nrz
import syszprint("writing on stdout")z%sys.stderr.write("writing on stderr")z
sys.exit(123)zONon-zero return code: 123.+Stdout:
writing on stdout.+Stderr:
writing on stderrz-c)	r�re�compile�DOTALLrrrrr	)Zcode_with_non_zero_exit�patternrrr�/test_check_subprocess_call_non_zero_return_code(s	rc
Cshdjdddddddd	dg	�}tjd
tj�}tt|ttjd|gdd
�dS)Nrzimport timez
import syszprint("before sleep on stdout")zsys.stdout.flush()z*sys.stderr.write("before sleep on stderr")zsys.stderr.flush()ztime.sleep(1.1)z-print("process should have be killed before")zVNon-zero return code:.+Stdout:
before sleep on stdout\s+Stderr:
before sleep on stderrz-c�timeout�)	rrrrrrrrr	)Zcode_timing_outrrrr�"test_check_subprocess_call_timeout8s"	r)rr�
nose.toolsrZjoblib.testingrrr
rrrrrrrr�<module>s