From: Berker Peksag Date: Sun, 29 Jun 2014 12:54:56 +0000 (+0300) Subject: Issue #20753: Skip PasswordProtectedSiteTestCase when Python is built without threads. X-Git-Tag: v3.4.2rc1~292 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ad324f6bccfe50b31b0c0769f4aa382baef42f91;p=thirdparty%2FPython%2Fcpython.git Issue #20753: Skip PasswordProtectedSiteTestCase when Python is built without threads. --- diff --git a/Lib/test/test_robotparser.py b/Lib/test/test_robotparser.py index 68a5e9ce2fd0..d01266f330eb 100644 --- a/Lib/test/test_robotparser.py +++ b/Lib/test/test_robotparser.py @@ -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):