]> granicus.if.org Git - python/commitdiff
Fix SF bugs #692951 and 692988, test_timeout.py needs 'network' resource
authorNeal Norwitz <nnorwitz@gmail.com>
Fri, 28 Feb 2003 19:57:03 +0000 (19:57 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Fri, 28 Feb 2003 19:57:03 +0000 (19:57 +0000)
require -u network to run test_timeout since
it fails when not connected to a network.

Lib/test/regrtest.py
Lib/test/test_timeout.py
Misc/NEWS

index 93c501138545f5873ab446c947d44d3edba04d46..73775680e6d61d34d2b1408b88d69e83d3dfef39 100755 (executable)
@@ -543,6 +543,9 @@ def printlist(x, width=70, indent=4):
 #     test_socket_ssl
 #         Controlled by test_socket_ssl.skip_expected.  Requires the network
 #         resource, and a socket module with ssl support.
+#     test_timeout
+#         Controlled by test_timeout.skip_expected.  Requires the network
+#         resource and a socket module.
 
 _expectations = {
     'win32':
@@ -945,6 +948,7 @@ class _ExpectedSkips:
         import os.path
         from test import test_normalization
         from test import test_socket_ssl
+        from test import test_timeout
 
         self.valid = False
         if sys.platform in _expectations:
@@ -960,6 +964,9 @@ class _ExpectedSkips:
             if test_socket_ssl.skip_expected:
                 self.expected.add('test_socket_ssl')
 
+            if test_timeout.skip_expected:
+                self.expected.add('test_timeout')
+
             if not sys.platform in ("mac", "darwin"):
                 self.expected.add("test_macostools")
                 self.expected.add("test_macfs")
index 5949e51a1fac4ecea21734880b9ec1982066991a..07c5372eea15808debc443765c3077b67e374af3 100644 (file)
@@ -3,6 +3,9 @@
 import unittest
 from test import test_support
 
+# This requires the 'network' resource as given on the regrtest command line.
+skip_expected = not test_support.is_resource_enabled('network')
+
 import time
 import socket
 
@@ -182,6 +185,8 @@ class TimeoutTestCase(unittest.TestCase):
 
 
 def test_main():
+    test_support.requires('network')
+
     suite = unittest.TestSuite()
     suite.addTest(unittest.makeSuite(CreationTestCase))
     suite.addTest(unittest.makeSuite(TimeoutTestCase))
index b3ea1f54903bd56cfa6747c41d7b4e0f3d9e1575..c4401b60ac46c41cd6acc8303b70e3a28d9c2ae0 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -57,7 +57,8 @@ TBD
 Tests
 -----
 
-TBD
+- test_timeout now requires -u network to be passed to regrtest to run.
+  See SF bug #692988.
 
 Windows
 -------