֦ik J d dl Z d dlZd dlZd dlZddlmZ dZ G d de Zy) N )TestCaseTc e Zd Zd fd Zd Zd Zd Zd Zd Zd Z d Z d Zd Zd Z d Zd Zd fd Z fdZd Z xZS )IsolatedAsyncioTestCasec d t | | d | _ t j | _ y N)super__init___asyncioRunnercontextvarscopy_context_asyncioTestContext)self methodName __class__s ,/usr/lib64/python3.12/unittest/async_case.pyr z IsolatedAsyncioTestCase.__init__$ s) $"#.#;#;#= c K y wr r s r asyncSetUpz"IsolatedAsyncioTestCase.asyncSetUp) c K y wr r r s r asyncTearDownz%IsolatedAsyncioTestCase.asyncTearDown, r r c 0 | j |g|i | y r ) addCleanupr funcargskwargss r addAsyncCleanupz'IsolatedAsyncioTestCase.addAsyncCleanup/ s $1&1r c K t | } |j }|j } || d { }| j ||d d d |S # t $ r( t d|j d|j d d w xY w7 Ow)N'.zC' object does not support the asynchronous context manager protocol)type __aenter__ __aexit__AttributeError TypeError __module____qualname__r" )r cmclsenterexitresults r enterAsyncContextz)IsolatedAsyncioTestCase.enterAsyncContext> s 2h 'NNE==D RyT2tT48 'a/q1A1A0B CT U "& ' ' !s% BA BBB1B Bc | j j | j j | j | j | j y r )r get_loopr runsetUp _callAsyncr r s r _callSetUpz"IsolatedAsyncioTestCase._callSetUpR s> $$& $$TZZ0(r c h | j | !t j d| dt d y y )NzFIt is deprecated to return a value that is not None from a test case () ) stacklevel)_callMaybeAsyncwarningswarnDeprecationWarning)r methods r _callTestMethodz'IsolatedAsyncioTestCase._callTestMethodZ s<