diff --git a/Lib/test/test_robotparser.py b/Lib/test/test_robotparser.py index 08bdf59d333..3821d66c2db 100644 --- a/Lib/test/test_robotparser.py +++ b/Lib/test/test_robotparser.py @@ -345,6 +345,7 @@ def testPasswordProtectedSite(self): 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 c498d3d12e2..2edb1e0c0e2 100644 --- a/Lib/test/test_socketserver.py +++ b/Lib/test/test_socketserver.py @@ -21,6 +21,8 @@ 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 70a0175d771..fa85c7e6cd8 100644 --- a/Lib/test/test_timeout.py +++ b/Lib/test/test_timeout.py @@ -5,9 +5,6 @@ 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 @@ def testRecvfromTimeout(self): def setUpModule(): support.requires('network') + support.requires_working_socket(module=True) if __name__ == "__main__":