]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-79940: skip `TestGetAsyncGenState` on wasm as it requires working sockets (GH...
authorThomas Krennwallner <tk@postsubmeta.net>
Sat, 11 Mar 2023 18:36:49 +0000 (13:36 -0500)
committerGitHub <noreply@github.com>
Sat, 11 Mar 2023 18:36:49 +0000 (10:36 -0800)
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
Lib/test/test_inspect.py

index 410a2e5b5468f02477e8c27b9ad6a9a9f7226800..803b259d961f540bc086cf09ea4715fa38a1fc78 100644 (file)
@@ -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):