[Python-checkins] [3.11] gh-107895: Fix test_asyncio.test_runners when run it in CPython's "development mode" (GH-108168) (GH-108197)

serhiy-storchaka webhook-mailer at python.org
Mon Aug 21 04:36:41 EDT 2023


https://github.com/python/cpython/commit/d4c66bd7328f6aadb584d54f81ae5281a66d08c4
commit: d4c66bd7328f6aadb584d54f81ae5281a66d08c4
branch: 3.11
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: serhiy-storchaka <storchaka at gmail.com>
date: 2023-08-21T08:36:37Z
summary:

[3.11] gh-107895: Fix test_asyncio.test_runners when run it in CPython's "development mode" (GH-108168) (GH-108197)

(cherry picked from commit 014a5b71e7538926ae1c03c8c5ea13c96e741be3)

Co-authored-by: Joon Hwan 김준환 <xncbf12 at gmail.com>

files:
M Lib/test/test_asyncio/test_runners.py

diff --git a/Lib/test/test_asyncio/test_runners.py b/Lib/test/test_asyncio/test_runners.py
index 4e3acb97c85d3..8a4aba6d470ba 100644
--- a/Lib/test/test_asyncio/test_runners.py
+++ b/Lib/test/test_asyncio/test_runners.py
@@ -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():



More information about the Python-checkins mailing list