diff options
author | Ned Deily <nad@acm.org> | 2014-03-27 06:25:02 (GMT) |
---|---|---|
committer | Ned Deily <nad@acm.org> | 2014-03-27 06:25:02 (GMT) |
commit | c727533cf57269173b88d3ce465809c5ca2bee22 (patch) | |
tree | b71528eb2b06fd6e34bfbbf591298009065c8203 /Lib/test/test_robotparser.py | |
parent | 6d9117604f9198044add00c71bc672c2ee54b7b7 (diff) | |
download | cpython-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.py | 7 |
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'): |