From 6ab6bcfcfa3f4e283c77b29921b82f3aac3ae4a3 Mon Sep 17 00:00:00 2001 From: Thomas Krennwallner Date: Sat, 11 Mar 2023 10:10:51 -0500 Subject: [PATCH 1/2] TestGetAsyncGenState requires working sockets Skip `TestGetAsyncGenState` and restoring of the default event loop policy in `test_inspect` if platform lacks working socket support. Fixes #11590 --- Lib/test/test_inspect.py | 4 +++- .../next/Tests/2023-03-11-11-14-01.gh-issue-79940.UH4d3k.rst | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Tests/2023-03-11-11-14-01.gh-issue-79940.UH4d3k.rst diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py index 410a2e5b5468f0..803b259d961f54 100644 --- a/Lib/test/test_inspect.py +++ b/Lib/test/test_inspect.py @@ -67,7 +67,8 @@ def revise(filename, *args): def tearDownModule(): - asyncio.set_event_loop_policy(None) + if support.has_socket_support: + asyncio.set_event_loop_policy(None) def signatures_with_lexicographic_keyword_only_parameters(): @@ -2326,6 +2327,7 @@ async def func(a=None): {'a': None, 'gencoro': gencoro, 'b': 'spam'}) +@support.requires_working_socket() class TestGetAsyncGenState(unittest.IsolatedAsyncioTestCase): def setUp(self): diff --git a/Misc/NEWS.d/next/Tests/2023-03-11-11-14-01.gh-issue-79940.UH4d3k.rst b/Misc/NEWS.d/next/Tests/2023-03-11-11-14-01.gh-issue-79940.UH4d3k.rst new file mode 100644 index 00000000000000..09254f305ee8d4 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2023-03-11-11-14-01.gh-issue-79940.UH4d3k.rst @@ -0,0 +1,2 @@ +Fix failed :mod:`test_inspect` tests on wasm32-emscripten and wasm32-wasi. +Patch by Thomas Krennwallner. From ea7431d82feaf90974a4aa8f0cf4e0baacfd7da1 Mon Sep 17 00:00:00 2001 From: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Date: Sat, 11 Mar 2023 23:35:38 +0530 Subject: [PATCH 2/2] Delete 2023-03-11-11-14-01.gh-issue-79940.UH4d3k.rst --- .../next/Tests/2023-03-11-11-14-01.gh-issue-79940.UH4d3k.rst | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 Misc/NEWS.d/next/Tests/2023-03-11-11-14-01.gh-issue-79940.UH4d3k.rst diff --git a/Misc/NEWS.d/next/Tests/2023-03-11-11-14-01.gh-issue-79940.UH4d3k.rst b/Misc/NEWS.d/next/Tests/2023-03-11-11-14-01.gh-issue-79940.UH4d3k.rst deleted file mode 100644 index 09254f305ee8d4..00000000000000 --- a/Misc/NEWS.d/next/Tests/2023-03-11-11-14-01.gh-issue-79940.UH4d3k.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix failed :mod:`test_inspect` tests on wasm32-emscripten and wasm32-wasi. -Patch by Thomas Krennwallner.