Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
Open
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, bugs and security fixesdocsDocumentation in the Doc dirDocumentation in the Doc dirstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
Description
Example:
importunittestevents= [] classTest(unittest.IsolatedAsyncioTestCase): deftest(self): events.append('started') self.addCleanup(events.append, 'cleanup') self.doCleanups() events.append('end') unittest.main(exit=False) assertevents== ['started', 'cleanup', 'end'], eventsThe above passes in 3.9 and 3.10, but fails in 3.11 with
E ====================================================================== ERROR: test (__main__.Test) ---------------------------------------------------------------------- Traceback (most recent call last): File "/.../cpython/Lib/unittest/async_case.py", line 75, in _callCleanup self._callMaybeAsync(function, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/.../cpython/Lib/unittest/async_case.py", line 95, in _callMaybeAsync return self._asyncioTestContext.run(func, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeError: cannot enter context: <_contextvars.Context object at 0x7fb2f93a9900> is already entered ---------------------------------------------------------------------- Ran 1 test in 0.002s FAILED (errors=1) Traceback (most recent call last): File "<stdin>", line 16, in <module> AssertionError: ['started', 'end'] Metadata
Metadata
Assignees
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, bugs and security fixesdocsDocumentation in the Doc dirDocumentation in the Doc dirstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
Projects
Status
Todo
Status
Todo