From cbc2c199a071d4d94b92c835324bf2ab721bb507 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Fri, 6 May 2022 12:08:36 +0200 Subject: gh-84461: Skip network require tests on Emscripten (GH-92383) --- Lib/test/test_robotparser.py | 1 + Lib/test/test_socketserver.py | 2 ++ Lib/test/test_timeout.py | 4 +--- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Lib/test/test_robotparser.py b/Lib/test/test_robotparser.py index 08bdf59..3821d66 100644 --- a/Lib/test/test_robotparser.py +++ b/Lib/test/test_robotparser.py @@ -345,6 +345,7 @@ class PasswordProtectedSiteTestCase(unittest.TestCase): self.assertFalse(parser.can_fetch("*", robots_url)) +@support.requires_working_socket() class NetworkTestCase(unittest.TestCase): base_url = 'http://www.pythontest.net/' diff --git a/Lib/test/test_socketserver.py b/Lib/test/test_socketserver.py index c498d3d..2edb1e0 100644 --- a/Lib/test/test_socketserver.py +++ b/Lib/test/test_socketserver.py @@ -21,6 +21,8 @@ from test.support import threading_helper test.support.requires("network") +test.support.requires_working_socket(module=True) + TEST_STR = b"hello world\n" HOST = socket_helper.HOST diff --git a/Lib/test/test_timeout.py b/Lib/test/test_timeout.py index 70a0175..fa85c7e 100644 --- a/Lib/test/test_timeout.py +++ b/Lib/test/test_timeout.py @@ -5,9 +5,6 @@ import unittest from test import support from test.support import socket_helper -# This requires the 'network' resource as given on the regrtest command line. -skip_expected = not support.is_resource_enabled('network') - import time import errno import socket @@ -292,6 +289,7 @@ class UDPTimeoutTestCase(TimeoutTestCase): def setUpModule(): support.requires('network') + support.requires_working_socket(module=True) if __name__ == "__main__": -- cgit v0.12