Skip to content

Commit

Permalink
TestGetAsyncGenState requires working sockets
Browse files Browse the repository at this point in the history
Skip `TestGetAsyncGenState` and restoring of the default event loop
policy in `test_inspect` if platform lacks working socket support.

Fixes #11590
  • Loading branch information
tkren committed Mar 11, 2023
1 parent ced13c9 commit 184f617
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Lib/test/test_inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix failed `test_inspect` tests on wasm32-emscripten and wasm32-wasi.

0 comments on commit 184f617

Please sign in to comment.