Skip to content

Commit

Permalink
[3.11] pythongh-107895: Fix test_asyncio.test_runners when run it in …
Browse files Browse the repository at this point in the history
…CPython's "development mode" (pythonGH-108168) (pythonGH-108197)

(cherry picked from commit 014a5b7)

Co-authored-by: Joon Hwan 김준환 <xncbf12@gmail.com>
  • Loading branch information
miss-islington and xncbf committed Aug 21, 2023
1 parent 4be05aa commit d4c66bd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Lib/test/test_asyncio/test_runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,14 @@ async def main(expected):
loop = asyncio.get_event_loop()
self.assertIs(loop.get_debug(), expected)

asyncio.run(main(False))
asyncio.run(main(False), debug=False)
asyncio.run(main(True), debug=True)
with mock.patch('asyncio.coroutines._is_debug_mode', lambda: True):
asyncio.run(main(True))
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):
async def main():
Expand Down

0 comments on commit d4c66bd

Please sign in to comment.