gkJddlZddlZddlZddlZddlmZdZGddeZy)N)TestCaseTceZdZdfd ZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd Zdfd ZfdZdZxZS)IsolatedAsyncioTestCasecdt||d|_tj|_yN)super__init___asyncioRunner contextvars copy_context_asyncioTestContext)self methodName __class__s :/opt/alt/python312/lib64/python3.12/unittest/async_case.pyr z IsolatedAsyncioTestCase.__init__$s) $"#.#;#;#= c Kywrrs r asyncSetUpz"IsolatedAsyncioTestCase.asyncSetUp)  c Kywrrrs r asyncTearDownz%IsolatedAsyncioTestCase.asyncTearDown,rrc0|j|g|i|yr) addCleanuprfuncargskwargss raddAsyncCleanupz'IsolatedAsyncioTestCase.addAsyncCleanup/s $1&1rcK t|} |j}|j}||d{}|j||ddd|S#t$r(t d|j d|j ddwxYw7Ow)N'.zC' object does not support the asynchronous context manager protocol)type __aenter__ __aexit__AttributeError TypeError __module__ __qualname__r")rcmclsenterexitresults renterAsyncContextz)IsolatedAsyncioTestCase.enterAsyncContext>s 2h 'NNE==D Ry T2tT48  'a/q1A1A0BCTU"& ' '!s% BA BBB1BBc|jj|jj|j|j |j yr)r get_looprrunsetUp _callAsyncrrs r _callSetUpz"IsolatedAsyncioTestCase._callSetUpRs> $$&   $$TZZ0 (rch|j|!tjd|dtdyy)NzFIt is deprecated to return a value that is not None from a test case ()) stacklevel)_callMaybeAsyncwarningswarnDeprecationWarning)rmethods r_callTestMethodz'IsolatedAsyncioTestCase._callTestMethodZs<    ' 3 MM((.xq23ERS U 4rc|j|j|jj|jyr)r7rrr5tearDownrs r _callTearDownz%IsolatedAsyncioTestCase._callTearDown_s, **+   $$T]]3rc0|j|g|i|yr)r=)rfunctionr r!s r _callCleanupz$IsolatedAsyncioTestCase._callCleanupcsX777rc\|jj||i||jSN)context)r r5rrs rr7z"IsolatedAsyncioTestCase._callAsyncfs8""&& $ !& !,,'  rctj|r-|jj||i||jS|jj|g|i|SrJ)inspectiscoroutinefunctionr r5rrs rr=z'IsolatedAsyncioTestCase._callMaybeAsyncnsi  & &t ,&&**d%f%00+  04++//FtFvF Frc>tjd}||_y)NT)debug)asyncioRunnerr rrunners r_setupAsyncioRunnerz+IsolatedAsyncioTestCase._setupAsyncioRunnerxsd+$rc<|j}|jyr)r closerSs r_tearDownAsyncioRunnerz.IsolatedAsyncioTestCase._tearDownAsyncioRunner}s$$ rc|j t| ||jS#|jwxYwr)rUr r5rX)rr1rs rr5zIsolatedAsyncioTestCase.runs9   " *7;v&  ' ' )D ' ' )s 2Acb|jt| |jyr)rUr rPrX)rrs rrPzIsolatedAsyncioTestCase.debugs$   "   ##%rc>|j|jyyr)r rXrs r__del__zIsolatedAsyncioTestCase.__del__s    *  ' ' ) +r)runTestr)__name__r+r,r rrr"r2r8rBrErHr7r=rUrXr5rPr\ __classcell__)rs@rrr sU4>    2()U 48 G% *& *rr)rQr rMr>caser __unittestrrrrrbs'  E*hE*r