Your IP : 216.73.216.213


Current Path : /opt/alt/python33/lib64/python3.3/test/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/test/__pycache__/test_concurrent_futures.cpython-33.pyo

�
��fDZc@s:ddlZejjd�ejjd�ejjd�ddlmZddlZddlZddlZddl	Z	ddl
mZddlm
Z
mZmZmZmZmZddlmZe
ddd	d
�Zede
�Zede�Zede�Zede�Zedede��Zeded
d�Zdd�Zdd�Zdd�Z Gdd�d�Z!Gdd�de!�Z"Gdd�de!�Z#Gdd�d�Z$Gdd�de"e$e	j%�Z&Gdd �d e#e$e	j%�Z'Gd!d"�d"�Z(Gd#d$�d$e"e(e	j%�Z)Gd%d&�d&e#e(e	j%�Z*Gd'd(�d(�Z+Gd)d*�d*e"e+e	j%�Z,Gd+d,�d,e#e+e	j%�Z-Gd-d.�d.�Z.Gd/d0�d0e"e.e	j%�Z/Gd1d2�d2e#e.e	j%�Z0Gd3d4�d4e	j%�Z1ejj2d5d6��Z3e4d7kr6e3�ndS(8iNu_multiprocessingumultiprocessing.synchronizeu	threading(uassert_python_ok(ufutures(uPENDINGuRUNNINGu	CANCELLEDuCANCELLED_AND_NOTIFIEDuFINISHEDuFuture(uBrokenProcessPoolcCs(t�}||_||_||_|S(N(uFutureu_stateu
_exceptionu_result(ustateu	exceptionuresultuf((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyu
create_futures
				u
create_futureustateu	exceptionuresulti*cCs||S(N((uxuy((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyumul)sumulcCstj|�td��dS(Nuthis is an exception(utimeusleepu	Exception(ut((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyusleep_and_raise-s
usleep_and_raisecCs(tj|�t|�tjj�dS(N(utimeusleepuprintusysustdoutuflush(utumsg((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyusleep_and_print1s

usleep_and_printcBs>|EeZdZdZdd�Zdd�Zdd�ZdS(	u
ExecutorMixinicCsttj�|_y|jd|j�|_Wn8tk
re}z|jt|��WYdd}~XnX|j�dS(Numax_workers(	utimeut1u
executor_typeuworker_countuexecutoruNotImplementedErroruskipTestustru_prime_executor(uselfue((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyusetUp:s&uExecutorMixin.setUpcCs`|jjdd�tj�|j}tjjrItd|dd�n|j	|dd�dS(Nuwaitu%.2fsuendu i<u+synchronization issue: test lasted too longT(
uexecutorushutdownuTrueutimeut1utestusupportuverboseuprintu
assertLess(uselfudt((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutearDownBs
uExecutorMixin.tearDowncsA�fdd�t�j�D�}x|D]}|j�q)WdS(Ncs(g|]}�jjtjd��qS(g�������?(uexecutorusubmitutimeusleep(u.0u_(uself(uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyu
<listcomp>Ls	u1ExecutorMixin._prime_executor.<locals>.<listcomp>(urangeuworker_counturesult(uselfufuturesuf((uselfuA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyu_prime_executorIs
uExecutorMixin._prime_executorN(u__name__u
__module__u__qualname__uworker_countusetUputearDownu_prime_executor(u
__locals__((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyu
ExecutorMixin7su
ExecutorMixincBs|EeZdZejZdS(uThreadPoolMixinN(u__name__u
__module__u__qualname__ufuturesuThreadPoolExecutoru
executor_type(u
__locals__((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyuThreadPoolMixinSsuThreadPoolMixincBs|EeZdZejZdS(uProcessPoolMixinN(u__name__u
__module__u__qualname__ufuturesuProcessPoolExecutoru
executor_type(u
__locals__((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyuProcessPoolMixinWsuProcessPoolMixincBs8|EeZdZdd�Zdd�Zdd�ZdS(uExecutorShutdownTestcCs0|jj�|jt|jjtdd�dS(Nii(uexecutorushutdownuassertRaisesuRuntimeErrorusubmitupow(uself((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_run_after_shutdown\s
		u,ExecutorShutdownTest.test_run_after_shutdowncCsQtddjd|jj��\}}}|j|�|j|j�d�dS(Nu-cuif 1:
            from concurrent.futures import {executor_type}
            from time import sleep
            from test.test_concurrent_futures import sleep_and_print
            t = {executor_type}(5)
            t.submit(sleep_and_print, 1.0, "apple")
            u
executor_typesapple(uassert_python_okuformatu
executor_typeu__name__uassertFalseuassertEqualustrip(uselfurcuoutuerr((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_interpreter_shutdownbs$
u.ExecutorShutdownTest.test_interpreter_shutdowncsK�fdd�td�D�}�jj�x|D]}|j�q3WdS(Ncs(g|]}�jjtjd��qS(g�������?(uexecutorusubmitutimeusleep(u.0u_(uself(uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyu
<listcomp>qs	u=ExecutorShutdownTest.test_hang_issue12364.<locals>.<listcomp>i2(urangeuexecutorushutdownuresult(uselfufsuf((uselfuA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_hang_issue12364ps

u)ExecutorShutdownTest.test_hang_issue12364N(u__name__u
__module__u__qualname__utest_run_after_shutdownutest_interpreter_shutdownutest_hang_issue12364(u
__locals__((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyuExecutorShutdownTest[suExecutorShutdownTestcBsD|EeZdZdd�Zdd�Zdd�Zdd�Zd	S(
uThreadPoolShutdownTestcCsdS(N((uself((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyu_prime_executorxsu&ThreadPoolShutdownTest._prime_executorcCs�|jjtdd�|jjtdd�|jjtdd�|jt|jj�d�|jj�x|jjD]}|j�qxWdS(Niiiiii(uexecutorusubmitumuluassertEqualulenu_threadsushutdownujoin(uselfut((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_threads_terminate{s
u-ThreadPoolShutdownTest.test_threads_terminatecCs�tjdd��V}|}|jt|jttdd���ddddddddddg
�WdQXx|jD]}|j�qtWdS(	Numax_workersiiiiiii����(	ufuturesuThreadPoolExecutoruassertEqualulistumapuabsurangeu_threadsujoin(uselfueuexecutorut((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_context_manager_shutdown�s$+u4ThreadPoolShutdownTest.test_context_manager_shutdowncCsVtjdd�}|jttdd��|j}~x|D]}|j�q>WdS(Numax_workersii����(ufuturesuThreadPoolExecutorumapuabsurangeu_threadsujoin(uselfuexecutoruthreadsut((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_del_shutdown�s	
u(ThreadPoolShutdownTest.test_del_shutdownN(u__name__u
__module__u__qualname__u_prime_executorutest_threads_terminateutest_context_manager_shutdownutest_del_shutdown(u
__locals__((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyuThreadPoolShutdownTestws		uThreadPoolShutdownTestcBsD|EeZdZdd�Zdd�Zdd�Zdd�Zd	S(
uProcessPoolShutdownTestcCsdS(N((uself((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyu_prime_executor�su'ProcessPoolShutdownTest._prime_executorcCs�|jjtdd�|jjtdd�|jjtdd�|jt|jj�d�|jj}|jj�x|j�D]}|j�q�WdS(Niiiiiii(	uexecutorusubmitumuluassertEqualulenu
_processesushutdownuvaluesujoin(uselfu	processesup((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_processes_terminate�s
u0ProcessPoolShutdownTest.test_processes_terminatecCs�tjdd��Y}|j}|jt|jttdd���ddddddddddg
�WdQXx|j�D]}|j	�qzWdS(	Numax_workersiiiiiii����(
ufuturesuProcessPoolExecutoru
_processesuassertEqualulistumapuabsurangeuvaluesujoin(uselfueu	processesup((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_context_manager_shutdown�s	$+u5ProcessPoolShutdownTest.test_context_manager_shutdowncCsutjdd�}t|jttdd���|j}|j}~|j�x|j	�D]}|j�q]WdS(Numax_workersii����(
ufuturesuProcessPoolExecutorulistumapuabsurangeu_queue_management_threadu
_processesujoinuvalues(uselfuexecutoruqueue_management_threadu	processesup((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_del_shutdown�s		
u)ProcessPoolShutdownTest.test_del_shutdownN(u__name__u
__module__u__qualname__u_prime_executorutest_processes_terminateutest_context_manager_shutdownutest_del_shutdown(u
__locals__((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyuProcessPoolShutdownTest�s	uProcessPoolShutdownTestcBsh|EeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS(u	WaitTestscCs�|jjtdd�}|jjtjd�}tjt||gdtj�\}}|j	t
|g�|�|j	t
t|g�|�dS(Niig�?ureturn_when(uexecutorusubmitumulutimeusleepufuturesuwaituCANCELLED_FUTUREuFIRST_COMPLETEDuassertEqualuset(uselfufuture1ufuture2udoneunot_done((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_first_completed�suWaitTests.test_first_completedcCsx|jjtjd�}tjtt|gdtj�\}}|j	t
ttg�|�|j	t
|g�|�dS(Ng�?ureturn_when(uexecutorusubmitutimeusleepufuturesuwaituCANCELLED_AND_NOTIFIED_FUTUREuSUCCESSFUL_FUTUREuFIRST_COMPLETEDuassertEqualuset(uselfufuture1ufinishedupending((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyu+test_first_completed_some_already_completed�su5WaitTests.test_first_completed_some_already_completedcCs�|jjtdd�}|jjtd�}|jjtjd�}tj|||gdtj�\}}|j	t
||g�|�|j	t
|g�|�dS(Niig�?iureturn_when(uexecutorusubmitumulusleep_and_raiseutimeusleepufuturesuwaituFIRST_EXCEPTIONuassertEqualuset(uselfufuture1ufuture2ufuture3ufinishedupending((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_first_exception�suWaitTests.test_first_exceptioncCs�|jjtdd�}|jjtjd�}tjttt	||gdtj
�\}}|jttt	|g�|�|jtt|g�|�dS(Niig�?ureturn_when(
uexecutorusubmitudivmodutimeusleepufuturesuwaituSUCCESSFUL_FUTUREuCANCELLED_FUTUREuCANCELLED_AND_NOTIFIED_FUTUREuFIRST_EXCEPTIONuassertEqualuset(uselfufuture1ufuture2ufinishedupending((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyu*test_first_exception_some_already_complete�su4WaitTests.test_first_exception_some_already_completecCsr|jjtjd�}tjt|gdtj�\}}|jt	tg�|�|jt	|g�|�dS(Niureturn_when(
uexecutorusubmitutimeusleepufuturesuwaituEXCEPTION_FUTUREuFIRST_EXCEPTIONuassertEqualuset(uselfufuture1ufinishedupending((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyu'test_first_exception_one_already_failed�su1WaitTests.test_first_exception_one_already_failedcCs�|jjtdd�}|jjtdd�}tjttt||gdtj	�\}}|j
tttt||g�|�|j
t�|�dS(Niiiureturn_when(uexecutorusubmitudivmodumulufuturesuwaituSUCCESSFUL_FUTUREuCANCELLED_AND_NOTIFIED_FUTUREuEXCEPTION_FUTUREu
ALL_COMPLETEDuassertEqualuset(uselfufuture1ufuture2ufinishedupending((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_all_completed�s	uWaitTests.test_all_completedcCs�|jjtdd�}|jjtjd�}tjttt	||gdddtj
�\}}|jtttt	|g�|�|jt|g�|�dS(Niiutimeoutiureturn_when(
uexecutorusubmitumulutimeusleepufuturesuwaituCANCELLED_AND_NOTIFIED_FUTUREuEXCEPTION_FUTUREuSUCCESSFUL_FUTUREu
ALL_COMPLETEDuassertEqualuset(uselfufuture1ufuture2ufinishedupending((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_timeout
suWaitTests.test_timeoutN(
u__name__u
__module__u__qualname__utest_first_completedu+test_first_completed_some_already_completedutest_first_exceptionu*test_first_exception_some_already_completeu'test_first_exception_one_already_failedutest_all_completedutest_timeout(u
__locals__((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyu	WaitTests�s
u	WaitTestscBs |EeZdZdd�ZdS(uThreadPoolWaitTestscs�tj���fdd��tj�}tjd�zF��fdd�td�D�}�j�tj|dtj	�Wdtj|�XdS(Ncs�j�dS(N(uwait((uevent(uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyufuture_func&su@ThreadPoolWaitTests.test_pending_calls_race.<locals>.future_funcg���ư>cs"h|]}�jj���qS((uexecutorusubmit(u.0ui(ufuture_funcuself(uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyu	<setcomp>+s	u>ThreadPoolWaitTests.test_pending_calls_race.<locals>.<setcomp>idureturn_when(
u	threadinguEventusysugetswitchintervalusetswitchintervalurangeusetufuturesuwaitu
ALL_COMPLETED(uselfuoldswitchintervalufs((ueventufuture_funcuselfuA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_pending_calls_race"s
"
u+ThreadPoolWaitTests.test_pending_calls_raceN(u__name__u
__module__u__qualname__utest_pending_calls_race(u
__locals__((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyuThreadPoolWaitTests suThreadPoolWaitTestscBs|EeZdZdS(uProcessPoolWaitTestsN(u__name__u
__module__u__qualname__(u
__locals__((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyuProcessPoolWaitTests2suProcessPoolWaitTestscBs8|EeZdZdd�Zdd�Zdd�ZdS(uAsCompletedTestscCs}|jjtdd�}|jjtdd�}ttjttt||g��}|j	tttt||g�|�dS(Niiii(
uexecutorusubmitumulusetufuturesuas_completeduCANCELLED_AND_NOTIFIED_FUTUREuEXCEPTION_FUTUREuSUCCESSFUL_FUTUREuassertEqual(uselfufuture1ufuture2u	completed((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_no_timeout8s		u AsCompletedTests.test_no_timeoutc
Cs�|jjtjd�}t�}y=x6tjttt	|gdd�D]}|j
|�qFWWntjk
ruYnX|jtttt	g�|�dS(Niutimeouti(
uexecutorusubmitutimeusleepusetufuturesuas_completeduCANCELLED_AND_NOTIFIED_FUTUREuEXCEPTION_FUTUREuSUCCESSFUL_FUTUREuadduTimeoutErroruassertEqual(uselfufuture1ucompleted_futuresufuture((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_zero_timeoutHs 			
	u"AsCompletedTests.test_zero_timeoutcCsT|jjtjd�}dd�tj||g�D�}|jt|�d�dS(NicSsg|]}|�qS(((u.0uf((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyu
<listcomp>_s	u;AsCompletedTests.test_duplicate_futures.<locals>.<listcomp>i(uexecutorusubmitutimeusleepufuturesuas_completeduassertEqualulen(uselfufuture1u	completed((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_duplicate_futures[s"u'AsCompletedTests.test_duplicate_futuresN(u__name__u
__module__u__qualname__utest_no_timeoututest_zero_timeoututest_duplicate_futures(u
__locals__((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyuAsCompletedTests6suAsCompletedTestscBs|EeZdZdS(uThreadPoolAsCompletedTestsN(u__name__u
__module__u__qualname__(u
__locals__((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyuThreadPoolAsCompletedTestscsuThreadPoolAsCompletedTestscBs|EeZdZdS(uProcessPoolAsCompletedTestsN(u__name__u
__module__u__qualname__(u
__locals__((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyuProcessPoolAsCompletedTestsgsuProcessPoolAsCompletedTestscBs\|EeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S(uExecutorTestcCs2|jjtdd�}|jd|j��dS(Niii(uexecutorusubmitupowuassertEqualuresult(uselfufuture((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_submitnsuExecutorTest.test_submitcCs5|jjtddd�}|jd|j��dS(Niuyii(uexecutorusubmitumuluassertEqualuresult(uselfufuture((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_submit_keywordrsu ExecutorTest.test_submit_keywordcCsV|jt|jjttd�td���ttttd�td����dS(Ni
(uassertEqualulistuexecutorumapupowurange(uself((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_mapvs'uExecutorTest.test_mapcCss|jjtddddgddddg�}|j|j�d�|j|j�d�|jt|j�dS(Niiiii(ii(ii(uexecutorumapudivmoduassertEqualu__next__uassertRaisesuZeroDivisionError(uselfui((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_map_exception{s0uExecutorTest.test_map_exceptioncCs�g}yCx<|jjtjdddgdd�D]}|j|�q1WWntjk
r`YnX|jd�|jddg|�dS(Niiutimeoutiuexpected TimeoutError(
uexecutorumaputimeusleepuappendufuturesuTimeoutErrorufailuassertEqualuNone(uselfuresultsui((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_map_timeout�s

uExecutorTest.test_map_timeoutcCs2|jjtdg|jd�|jj�dS(Nii(uexecutorumapustruworker_countushutdown(uself((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_shutdown_race_issue12456�s!u*ExecutorTest.test_shutdown_race_issue12456N(	u__name__u
__module__u__qualname__utest_submitutest_submit_keywordutest_maputest_map_exceptionutest_map_timeoututest_shutdown_race_issue12456(u
__locals__((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyuExecutorTestksuExecutorTestcBs |EeZdZdd�ZdS(uThreadPoolExecutorTestcs^g��fdd�}|jj|td��|jjdd�|j�td��dS(uTests verifying issue 11777.cs�j|�dS(N(uappend(un(ufinished(uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyurecord_finished�suRThreadPoolExecutorTest.test_map_submits_without_iteration.<locals>.record_finishedi
uwaitNT(uexecutorumapurangeushutdownuTrueuassertCountEqual(uselfurecord_finished((ufinisheduA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyu"test_map_submits_without_iteration�s
u9ThreadPoolExecutorTest.test_map_submits_without_iterationN(u__name__u
__module__u__qualname__u"test_map_submits_without_iteration(u
__locals__((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyuThreadPoolExecutorTest�suThreadPoolExecutorTestcBs |EeZdZdd�ZdS(uProcessPoolExecutorTestcCs�|jjtjd�g}tt|jjj���}|j�x!|D]}|j	t
|j�qJW|j	t
|jjtdd�dS(Niii(
uexecutorusubmitutimeusleepunextuiteru
_processesuvaluesu	terminateuassertRaisesuBrokenProcessPooluresultupow(uselfufuturesupufut((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_killed_child�s

u)ProcessPoolExecutorTest.test_killed_childN(u__name__u
__module__u__qualname__utest_killed_child(u
__locals__((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyuProcessPoolExecutorTest�suProcessPoolExecutorTestcBs�|EeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#S($uFutureTestscsOd��fdd�}t�}|j|�|jd�|jd��dS(Ncs|j��dS(N(uresult(ucallback_future(ucallback_result(uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyufn�su6FutureTests.test_done_callback_with_result.<locals>.fni(uNoneuFutureuadd_done_callbacku
set_resultuassertEqual(uselfufnuf((ucallback_resultuA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_done_callback_with_result�s	

u*FutureTests.test_done_callback_with_resultcsXd��fdd�}t�}|j|�|jtd��|jd�j�dS(Ncs|j��dS(N(u	exception(ucallback_future(ucallback_exception(uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyufn�su9FutureTests.test_done_callback_with_exception.<locals>.fnutest(utest(uNoneuFutureuadd_done_callbacku
set_exceptionu	ExceptionuassertEqualuargs(uselfufnuf((ucallback_exceptionuA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyu!test_done_callback_with_exception�s	
u-FutureTests.test_done_callback_with_exceptioncsRd��fdd�}t�}|j|�|j|j��|j��dS(Ncs|j��dS(N(u	cancelled(ucallback_future(u
was_cancelled(uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyufn�su6FutureTests.test_done_callback_with_cancel.<locals>.fn(uNoneuFutureuadd_done_callbacku
assertTrueucancel(uselfufnuf((u
was_cancelleduA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_done_callback_with_cancel�s	
u*FutureTests.test_done_callback_with_cancelc
s�tjj���}d�d��fdd�}�fdd�}t�}|j|�|j|�|jd�|j��|j��|jd|j	��WdQXdS(Ncsd�td��dS(Nudoh!T(uTrueu	Exception(ucallback_future(uraising_was_called(uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyu
raising_fn�su9FutureTests.test_done_callback_raises.<locals>.raising_fncs
d�dS(NT(uTrue(ucallback_future(u
fn_was_called(uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyufn�su1FutureTests.test_done_callback_raises.<locals>.fniuException: doh!F(
utestusupportucaptured_stderruFalseuFutureuadd_done_callbacku
set_resultu
assertTrueuassertInugetvalue(uselfustderru
raising_fnufnuf((u
fn_was_calleduraising_was_calleduA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_done_callback_raises�s	




u%FutureTests.test_done_callback_raisescsOd��fdd�}t�}|jd�|j|�|jd��dS(Ncs|j��dS(N(uresult(ucallback_future(ucallback_result(uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyufn�su=FutureTests.test_done_callback_already_successful.<locals>.fni(uNoneuFutureu
set_resultuadd_done_callbackuassertEqual(uselfufnuf((ucallback_resultuA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyu%test_done_callback_already_successful�s	

u1FutureTests.test_done_callback_already_successfulcsXd��fdd�}t�}|jtd��|j|�|jd�j�dS(Ncs|j��dS(N(u	exception(ucallback_future(ucallback_exception(uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyufn�su9FutureTests.test_done_callback_already_failed.<locals>.fnutest(utest(uNoneuFutureu
set_exceptionu	Exceptionuadd_done_callbackuassertEqualuargs(uselfufnuf((ucallback_exceptionuA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyu!test_done_callback_already_failed�s	
u-FutureTests.test_done_callback_already_failedcsRd��fdd�}t�}|j|j��|j|�|j��dS(Ncs|j��dS(N(u	cancelled(ucallback_future(u
was_cancelled(uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyufnsu<FutureTests.test_done_callback_already_cancelled.<locals>.fn(uNoneuFutureu
assertTrueucanceluadd_done_callback(uselfufnuf((u
was_cancelleduA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyu$test_done_callback_already_cancelled�s	
u0FutureTests.test_done_callback_already_cancelledcCs�|jtt�d�|jtt�d�|jtt�d�|jtt�d�|jtt�d�|jtt�d�dS(Nu%<Future at 0x[0-9a-f]+ state=pending>u%<Future at 0x[0-9a-f]+ state=running>u'<Future at 0x[0-9a-f]+ state=cancelled>u5<Future at 0x[0-9a-f]+ state=finished raised OSError>u3<Future at 0x[0-9a-f]+ state=finished returned int>(uassertRegexurepruPENDING_FUTUREuRUNNING_FUTUREuCANCELLED_FUTUREuCANCELLED_AND_NOTIFIED_FUTUREuEXCEPTION_FUTUREuSUCCESSFUL_FUTURE(uself((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyu	test_repr
s		uFutureTests.test_reprcCsQtdt�}tdt�}tdt�}tdt�}tdtdt��}tdtdd�}|j|j��|j	|j
t�|j|j��|j	|j
t�|j|j��|j	|j
t�|j|j��|j	|j
t�|j|j��|j	|j
t�|j|j��|j	|j
t�dS(Nustateu	exceptionuresulti(u
create_futureuPENDINGuRUNNINGu	CANCELLEDuCANCELLED_AND_NOTIFIEDuFINISHEDuOSErroru
assertTrueucanceluassertEqualu_stateuassertFalse(uselfuf1uf2uf3uf4uf5uf6((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_cancels$uFutureTests.test_cancelcCsv|jtj��|jtj��|jtj��|jtj��|jtj��|jtj��dS(N(	uassertFalseuPENDING_FUTUREu	cancelleduRUNNING_FUTUREu
assertTrueuCANCELLED_FUTUREuCANCELLED_AND_NOTIFIED_FUTUREuEXCEPTION_FUTUREuSUCCESSFUL_FUTURE(uself((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_cancelled5suFutureTests.test_cancelledcCsv|jtj��|jtj��|jtj��|jtj��|jtj��|jtj��dS(N(	uassertFalseuPENDING_FUTUREudoneuRUNNING_FUTUREu
assertTrueuCANCELLED_FUTUREuCANCELLED_AND_NOTIFIED_FUTUREuEXCEPTION_FUTUREuSUCCESSFUL_FUTURE(uself((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyu	test_done=suFutureTests.test_donecCsv|jtj��|jtj��|jtj��|jtj��|jtj��|jtj��dS(N(	uassertFalseuPENDING_FUTUREurunningu
assertTrueuRUNNING_FUTUREuCANCELLED_FUTUREuCANCELLED_AND_NOTIFIED_FUTUREuEXCEPTION_FUTUREuSUCCESSFUL_FUTURE(uself((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_runningEsuFutureTests.test_runningcCs�|jtjtjdd�|jtjtjdd�|jtjtjdd�|jtjtjdd�|jt	t
jdd�|jtjdd�d�dS(Nutimeoutii*(
uassertRaisesufuturesuTimeoutErroruPENDING_FUTUREuresultuRUNNING_FUTUREuCancelledErroruCANCELLED_FUTUREuCANCELLED_AND_NOTIFIED_FUTUREuOSErroruEXCEPTION_FUTUREuassertEqualuSUCCESSFUL_FUTURE(uself((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_result_with_timeoutMsu$FutureTests.test_result_with_timeoutcs]�fdd�}tdt��tjd|�}|j�|j�jdd�d�dS(Ncstjd��jd�dS(Nii*(utimeusleepu
set_result((uf1(uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyunotification[s
u:FutureTests.test_result_with_success.<locals>.notificationustateutargetutimeoutii*(u
create_futureuPENDINGu	threadinguThreadustartuassertEqualuresult(uselfunotificationut((uf1uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_result_with_successYs

u$FutureTests.test_result_with_successcs]�fdd�}tdt��tjd|�}|j�|jtj�jdd�dS(Ncstjd��j�dS(Ni(utimeusleepucancel((uf1(uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyunotificationhs
u9FutureTests.test_result_with_cancel.<locals>.notificationustateutargetutimeouti(	u
create_futureuPENDINGu	threadinguThreadustartuassertRaisesufuturesuCancelledErroruresult(uselfunotificationut((uf1uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_result_with_cancelfs

u#FutureTests.test_result_with_cancelcCs�|jtjtjdd�|jtjtjdd�|jtjtjdd�|jtjtjdd�|j	t
tjdd�t��|j
tjdd�d�dS(Nutimeouti(uassertRaisesufuturesuTimeoutErroruPENDING_FUTUREu	exceptionuRUNNING_FUTUREuCancelledErroruCANCELLED_FUTUREuCANCELLED_AND_NOTIFIED_FUTUREu
assertTrueu
isinstanceuEXCEPTION_FUTUREuOSErroruassertEqualuSUCCESSFUL_FUTUREuNone(uself((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_exception_with_timeoutss
u'FutureTests.test_exception_with_timeoutcsc�fdd�}tdt��tjd|�}|j�|jt�jdd�t��dS(Nc	sCtjd��j�'t�_t��_�jj�WdQXdS(Ni(utimeusleepu
_conditionuFINISHEDu_stateuOSErroru
_exceptionu
notify_all((uf1(uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyunotification�s


	u=FutureTests.test_exception_with_success.<locals>.notificationustateutargetutimeouti(	u
create_futureuPENDINGu	threadinguThreadustartu
assertTrueu
isinstanceu	exceptionuOSError(uselfunotificationut((uf1uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyutest_exception_with_success�s

u'FutureTests.test_exception_with_successN(u__name__u
__module__u__qualname__utest_done_callback_with_resultu!test_done_callback_with_exceptionutest_done_callback_with_cancelutest_done_callback_raisesu%test_done_callback_already_successfulu!test_done_callback_already_failedu$test_done_callback_already_cancelledu	test_reprutest_cancelutest_cancelledu	test_doneutest_runningutest_result_with_timeoututest_result_with_successutest_result_with_cancelutest_exception_with_timeoututest_exception_with_success(u
__locals__((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyuFutureTests�s"


uFutureTestsc
Cs)ztjjt�Wdtjj�XdS(N(utestusupporturun_unittestu__name__u
reap_children(((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyu	test_main�su	test_mainu__main__(5utest.supportutestusupportu
import_moduleutest.script_helperuassert_python_okusysu	threadingutimeuunittestu
concurrentufuturesuconcurrent.futures._baseuPENDINGuRUNNINGu	CANCELLEDuCANCELLED_AND_NOTIFIEDuFINISHEDuFutureuconcurrent.futures.processuBrokenProcessPooluNoneu
create_futureuPENDING_FUTUREuRUNNING_FUTUREuCANCELLED_FUTUREuCANCELLED_AND_NOTIFIED_FUTUREuOSErroruEXCEPTION_FUTUREuSUCCESSFUL_FUTUREumulusleep_and_raiseusleep_and_printu
ExecutorMixinuThreadPoolMixinuProcessPoolMixinuExecutorShutdownTestuTestCaseuThreadPoolShutdownTestuProcessPoolShutdownTestu	WaitTestsuThreadPoolWaitTestsuProcessPoolWaitTestsuAsCompletedTestsuThreadPoolAsCompletedTestsuProcessPoolAsCompletedTestsuExecutorTestuThreadPoolExecutorTestuProcessPoolExecutorTestuFutureTestsureap_threadsu	test_mainu__name__(((uA/opt/alt/python33/lib64/python3.3/test/test_concurrent_futures.pyu<module>sP. $e-,�