From: Thomas Krennwallner Date: Sat, 11 Mar 2023 18:36:49 +0000 (-0500) Subject: gh-79940: skip `TestGetAsyncGenState` on wasm as it requires working sockets (GH... X-Git-Tag: v3.12.0a7~204 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=534660f1680955c7a6a47d5c6bd9649704b74a87;p=thirdparty%2FPython%2Fcpython.git gh-79940: skip `TestGetAsyncGenState` on wasm as it requires working sockets (GH-102605) Skip `TestGetAsyncGenState` and restoring of the default event loop policy in `test_inspect` if platform lacks working socket support. Fixes #11590 Automerge-Triggered-By: GH:kumaraditya303 --- diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py index 410a2e5b5468..803b259d961f 100644 --- a/Lib/test/test_inspect.py +++ b/Lib/test/test_inspect.py @@ -67,7 +67,8 @@ git = mod.StupidGit() 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 @@ class TestGetCoroutineState(unittest.TestCase): {'a': None, 'gencoro': gencoro, 'b': 'spam'}) +@support.requires_working_socket() class TestGetAsyncGenState(unittest.IsolatedAsyncioTestCase): def setUp(self):