Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Bug report
» ./python.exe -m test test_contextlib_asyncUsing random seed 9082919800:00:00 load avg: 4.08 Run 1 test sequentially0:00:00 load avg: 4.08 [1/1] test_contextlib_async/Users/sobolev/Desktop/cpython/Lib/contextlib.py:701: RuntimeWarning: coroutine method 'aclose' of 'AsyncContextManagerTestCase.test_contextmanager_trap_second_yield.<locals>.whoo' was never awaited async def __aenter__(self):RuntimeWarning: Enable tracemalloc to get the object allocation traceback/Users/sobolev/Desktop/cpython/Lib/contextlib.py:701: RuntimeWarning: coroutine method 'aclose' of 'AsyncContextManagerTestCase.test_contextmanager_trap_yield_after_throw.<locals>.whoo' was never awaited async def __aenter__(self):RuntimeWarning: Enable tracemalloc to get the object allocation traceback/Users/sobolev/Desktop/cpython/Lib/contextlib.py:701: RuntimeWarning: coroutine method 'aclose' of 'TestAbstractAsyncContextManager.test_async_gen_propagates_generator_exit.<locals>.gen' was never awaited async def __aenter__(self):RuntimeWarning: Enable tracemalloc to get the object allocation traceback== Tests result: SUCCESS ==1 test OK.Total duration: 121 msTotal tests: run=58Total test files: run=1/1Result: SUCCESSThis can be fixed by moving away from legacy@_async_test and by using stabelIsolatedAsyncioTestCase.
cpython/Lib/test/test_contextlib_async.py
Lines 14 to 20 in6592976
| def_async_test(func): | |
| """Decorator to turn an async function into a test case.""" | |
| @functools.wraps(func) | |
| defwrapper(*args,**kwargs): | |
| coro=func(*args,**kwargs) | |
| asyncio.run(coro) | |
| returnwrapper |
Linked PRs
- gh-110378: Move to
IsolatedAsyncTestCaseintest_contextlib_async.py#110379 - gh-110378: Close invalid generators in contextmanager and asynccontextmanager #110499
- gh-110378: Fix test_async_gen_propagates_generator_exit in test_contextlib_async #110500
- [3.12] gh-110378: Close invalid generators in contextmanager and asynccontextmanager (GH-110499) #110588
- [3.11] gh-110378: Close invalid generators in contextmanager and asynccontextmanager (GH-110499) #110589
- [3.12] gh-110378: Fix test_async_gen_propagates_generator_exit in test_contextlib_async (GH-110500) #110610
- [3.11] gh-110378: Fix test_async_gen_propagates_generator_exit in test_contextlib_async (GH-110500) #110611
Metadata
Metadata
Assignees
Projects
Status
Done