fYNddlZddlZddlZddlZddlmZGddeZdS)N)TestCaseceZdZdfd ZdZdZdZdZdZdZ d Z d Z d Z d Z d ZdZdfd ZfdZdZxZS)IsolatedAsyncioTestCaserunTestct|d|_tj|_dSN)super__init___asyncioRunner contextvars copy_context_asyncioTestContext)self methodName __class__s :/opt/alt/python311/lib64/python3.11/unittest/async_case.pyr z IsolatedAsyncioTestCase.__init__#s: $$$"#.#;#=#=   c KdSr rs r asyncSetUpz"IsolatedAsyncioTestCase.asyncSetUp(  rc KdSr rrs r asyncTearDownz%IsolatedAsyncioTestCase.asyncTearDown+rrc(|j|g|Ri|dSr ) addCleanuprfuncargskwargss raddAsyncCleanupz'IsolatedAsyncioTestCase.addAsyncCleanup.s) $1&11111rcKt|} |j}|j}n/#t$r"t d|jd|jddwxYw||d{V}|||ddd|S)zEnters the supplied asynchronous context manager. If successful, also adds its __aexit__ method as a cleanup function and returns the result of the __aenter__ method. '.zC' object does not support the asynchronous context manager protocolN)type __aenter__ __aexit__AttributeError TypeError __module__ __qualname__r")rcmclsenterexitresults renterAsyncContextz)IsolatedAsyncioTestCase.enterAsyncContext=s2hh 'NE=DD ' ' 'UUU1AUUU"& ' 'uRyy T2tT4888 s ",Ac|j|j|j||jdSr )r get_looprrunsetUp _callAsyncrrs r _callSetUpz"IsolatedAsyncioTestCase._callSetUpQsL $$&&&  $$TZ000 (((((rct||"tjd|dtddSdS)NzFIt is deprecated to return a value that is not None from a test case ()) stacklevel)_callMaybeAsyncwarningswarnDeprecationWarning)rmethods r_callTestMethodz'IsolatedAsyncioTestCase._callTestMethodYsd    ' ' 3 M2(.2223ERS U U U U U U 4 3rcx||j|j|jdSr )r7rrr5tearDownrs r _callTearDownz%IsolatedAsyncioTestCase._callTearDown^s6 *+++  $$T]33333rc(|j|g|Ri|dSr )r=)rfunctionr r!s r _callCleanupz$IsolatedAsyncioTestCase._callCleanupbs+X777777777rc|j Jdtj|s J|d|j||i||jS)N!asyncio runner is not initializedz is not an async functioncontextr inspectiscoroutinefunctionr5rrs rr7z"IsolatedAsyncioTestCase._callAsyncesz"..0S...*400VVT2V2V2VVV0"&& D$ !& ! !,'   rc|j Jdtj|r'|j||i||jS|jj|g|Ri|S)NrJrKrMrs rr=z'IsolatedAsyncioTestCase._callMaybeAsyncms"..0S...  &t , , G&**d%f%%0+  04+/FtFFFvFF Frc`|j Jdtjd}||_dS)Nz%asyncio runner is already initializedT)debug)r asyncioRunnerrrunners r_setupAsyncioRunnerz+IsolatedAsyncioTestCase._setupAsyncioRunnerws:"**,S***d+++$rc<|j}|dSr )r closerUs r_tearDownAsyncioRunnerz.IsolatedAsyncioTestCase._tearDownAsyncioRunner|s$ rNc| t||S#|wxYwr )rWr r5rZ)rr1rs rr5zIsolatedAsyncioTestCase.runsZ   """ *77;;v&&  ' ' ) ) ) )D ' ' ) ) ) )s A A"c|t|dSr )rWr rRrZ)rrs rrRzIsolatedAsyncioTestCase.debugs>   """   ##%%%%%rc@|j|dSdSr )r rZrs r__del__zIsolatedAsyncioTestCase.__del__s+   *  ' ' ) ) ) ) ) + *r)rr )__name__r+r,r rrr"r2r8rBrErHr7r=rWrZr5rRr^ __classcell__)rs@rrr s=4>>>>>>        2 2 2()))UUU 444888   GGG%%% ******&&&&& *******rr)rSr rNr>caserrrrrrbs|E*E*E*E*E*hE*E*E*E*E*r