JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrJFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrU e5d@s0ddlZddlZddlmZGdddeZdS)N)TestCasecseZdZdfdd ZddZddZdd Zd d Zd d ZddZ ddZ ddZ ddZ ddZ ddZddZd fdd ZZS)!IsolatedAsyncioTestCaserunTestcst|d|_d|_dSN)super__init___asyncioTestLoop_asyncioCallsQueue)selfZ methodName __class__+/usr/lib64/python3.8/unittest/async_case.pyr"s z IsolatedAsyncioTestCase.__init__csdSrrr rrr asyncSetUp'sz"IsolatedAsyncioTestCase.asyncSetUpcsdSrrrrrr asyncTearDown*sz%IsolatedAsyncioTestCase.asyncTearDowncOs|j|f||dSr)Z addCleanup)r funcargskwargsrrraddAsyncCleanup-s z'IsolatedAsyncioTestCase.addAsyncCleanupcCs|||jdSr)ZsetUp _callAsyncrrrrr _callSetUp<sz"IsolatedAsyncioTestCase._callSetUpcCs||dSr_callMaybeAsync)r methodrrr_callTestMethod@sz'IsolatedAsyncioTestCase._callTestMethodcCs||j|dSr)rrZtearDownrrrr _callTearDownCs z%IsolatedAsyncioTestCase._callTearDowncOs|j|f||dSrr)r Zfunctionrrrrr _callCleanupGsz$IsolatedAsyncioTestCase._callCleanupcOsL|jdk st|||}t|s&t|j}|j||f|j|Srr AssertionErrorinspectZ isawaitable create_futurer put_nowaitrun_until_completer rrrretfutrrrrJs   z"IsolatedAsyncioTestCase._callAsynccOsP|jdk st|||}t|rH|j}|j||f|j|S|SdSrrr%rrrrRs    z'IsolatedAsyncioTestCase._callMaybeAsyncc st|_}|d|IdH}||dkr:dS|\}}z |IdH}|s`||Wqttfk r|Yqt tj fk r}z|s| |W5d}~XYqXqdSr) asyncioZQueuer Z set_resultgetZ task_done cancelled SystemExitKeyboardInterrupt BaseExceptionZCancelledErrorZ set_exception)r r'ZqueueZqueryZ awaitabler&Zexrrr_asyncioLoopRunner\s   z*IsolatedAsyncioTestCase._asyncioLoopRunnercCsX|jdkstt}t||d||_|}||||_ | |dS)NT) r r r(Znew_event_loopset_event_loopZ set_debugr"Z create_taskr.Z_asyncioCallsTaskr$)r loopr'rrr_setupAsyncioLoopos  z)IsolatedAsyncioTestCase._setupAsyncioLoopc Cs|jdk st|j}d|_|jd||jzt |}|sNWvdS|D] }| qR|tj ||dd|D]0}| rq|| dk r||d| |dq|||W5td|XdS)NT)r0Zreturn_exceptionsz(unhandled exception during test shutdown)message exceptiontask)r r r r#r$joinr(r/closeZ all_tasksZcancelZgatherr*r3Zcall_exception_handlerZshutdown_asyncgens)r r0Z to_cancelr4rrr_tearDownAsyncioLoopys4      z,IsolatedAsyncioTestCase._tearDownAsyncioLoopNcs(|zt|WS|XdSr)r1r7rrun)r resultr rrr8szIsolatedAsyncioTestCase.run)r)N)__name__ __module__ __qualname__rrrrrrrrrrr.r1r7r8 __classcell__rrr rrs  "r)r(r!Zcaserrrrrrs