mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
[3.12] gh-107895: Fix test_asyncio.test_runners when run it in CPython's "development mode" (GH-108168) (#108196)
gh-107895: Fix test_asyncio.test_runners when run it in CPython's "development mode" (GH-108168)
(cherry picked from commit 014a5b71e7
)
Co-authored-by: Joon Hwan 김준환 <xncbf12@gmail.com>
This commit is contained in:
parent
9cd15cab77
commit
639ffd5aa0
1 changed files with 4 additions and 1 deletions
|
@ -101,11 +101,14 @@ class RunTests(BaseTest):
|
||||||
loop = asyncio.get_event_loop()
|
loop = asyncio.get_event_loop()
|
||||||
self.assertIs(loop.get_debug(), expected)
|
self.assertIs(loop.get_debug(), expected)
|
||||||
|
|
||||||
asyncio.run(main(False))
|
asyncio.run(main(False), debug=False)
|
||||||
asyncio.run(main(True), debug=True)
|
asyncio.run(main(True), debug=True)
|
||||||
with mock.patch('asyncio.coroutines._is_debug_mode', lambda: True):
|
with mock.patch('asyncio.coroutines._is_debug_mode', lambda: True):
|
||||||
asyncio.run(main(True))
|
asyncio.run(main(True))
|
||||||
asyncio.run(main(False), debug=False)
|
asyncio.run(main(False), debug=False)
|
||||||
|
with mock.patch('asyncio.coroutines._is_debug_mode', lambda: False):
|
||||||
|
asyncio.run(main(True), debug=True)
|
||||||
|
asyncio.run(main(False))
|
||||||
|
|
||||||
def test_asyncio_run_from_running_loop(self):
|
def test_asyncio_run_from_running_loop(self):
|
||||||
async def main():
|
async def main():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue