summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_robotparser.py
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2014-03-27 06:25:02 (GMT)
committerNed Deily <nad@acm.org>2014-03-27 06:25:02 (GMT)
commitc727533cf57269173b88d3ce465809c5ca2bee22 (patch)
treeb71528eb2b06fd6e34bfbbf591298009065c8203 /Lib/test/test_robotparser.py
parent6d9117604f9198044add00c71bc672c2ee54b7b7 (diff)
downloadcpython-c727533cf57269173b88d3ce465809c5ca2bee22.zip
cpython-c727533cf57269173b88d3ce465809c5ca2bee22.tar.gz
cpython-c727533cf57269173b88d3ce465809c5ca2bee22.tar.bz2
Issue #20939: Use www.example.com instead of www.python.org to avoid test
failures when ssl is not present.
Diffstat (limited to 'Lib/test/test_robotparser.py')
-rw-r--r--Lib/test/test_robotparser.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_robotparser.py b/Lib/test/test_robotparser.py
index 651301b..36ac941 100644
--- a/Lib/test/test_robotparser.py
+++ b/Lib/test/test_robotparser.py
@@ -2,6 +2,12 @@ import unittest, StringIO, robotparser
from test import test_support
from urllib2 import urlopen, HTTPError
+HAVE_HTTPS = True
+try:
+ from urllib2 import HTTPSHandler
+except ImportError:
+ HAVE_HTTPS = False
+
class RobotTestCase(unittest.TestCase):
def __init__(self, index, parser, url, good, agent):
unittest.TestCase.__init__(self)
@@ -269,6 +275,7 @@ class NetworkTestCase(unittest.TestCase):
self.skipTest('%s is unavailable' % url)
self.assertEqual(parser.can_fetch("*", robots_url), False)
+ @unittest.skipUnless(HAVE_HTTPS, 'need SSL support to download license')
def testPythonOrg(self):
test_support.requires('network')
with test_support.transient_internet('www.python.org'):