Skip to content

Commit 1f00297

Browse files
Skip the asynchronous test on platforms without socket support
Running an asyncio event loop needs a working socket, which is why test_unittest.test_async_case skips the whole module without one.
1 parent 9deccd8 commit 1f00297

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Lib/test/test_support.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,6 +1269,8 @@ def test_it(self, a):
12691269
self.assertEqual(len(result.failures), 1)
12701270
self.assertEndsWith(result.failures[0][0].id(), 'test_it (a=2)')
12711271

1272+
# Running an asyncio event loop needs a working socket.
1273+
@support.requires_working_socket()
12721274
def test_async(self):
12731275
# An asynchronous test must be awaited: a synchronous wrapper would
12741276
# make it silently not run at all.

0 commit comments

Comments
 (0)