]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #20753: Skip PasswordProtectedSiteTestCase when Python is built without threads.
authorBerker Peksag <berker.peksag@gmail.com>
Sun, 29 Jun 2014 12:54:56 +0000 (15:54 +0300)
committerBerker Peksag <berker.peksag@gmail.com>
Sun, 29 Jun 2014 12:54:56 +0000 (15:54 +0300)
Lib/test/test_robotparser.py

index 68a5e9ce2fd0ddad4e620a3cc85ecfe584b71991..d01266f330eba69a3dff57a6277a481bbf37773a 100644 (file)
@@ -4,8 +4,11 @@ import urllib.robotparser
 from urllib.error import URLError, HTTPError
 from urllib.request import urlopen
 from test import support
-import threading
 from http.server import BaseHTTPRequestHandler, HTTPServer
+try:
+    import threading
+except ImportError:
+    threading = None
 
 
 class RobotTestCase(unittest.TestCase):
@@ -259,6 +262,7 @@ class RobotHandler(BaseHTTPRequestHandler):
         pass
 
 
+@unittest.skipUnless(threading, 'threading required for this test')
 class PasswordProtectedSiteTestCase(unittest.TestCase):
 
     def setUp(self):