From: Senthil Kumaran Date: Sun, 31 Jul 2011 03:48:54 +0000 (+0800) Subject: using test_support.transient_internet helper method in the urllib2net test. X-Git-Tag: v2.7.3rc1~553 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=23c2104118194cd04ce8f2378619c23c4a72ca49;p=thirdparty%2FPython%2Fcpython.git using test_support.transient_internet helper method in the urllib2net test. --- diff --git a/Lib/test/test_urllib2net.py b/Lib/test/test_urllib2net.py index 1375cdada008..4894151cbe41 100644 --- a/Lib/test/test_urllib2net.py +++ b/Lib/test/test_urllib2net.py @@ -190,9 +190,11 @@ class OtherNetworkTests(unittest.TestCase): # Some sites do not send Connection: close header. # Verify that those work properly. (#issue12576) - req = urllib2.urlopen('http://www.imdb.com') - res = req.read() - self.assertTrue(res) + URL = 'http://www.imdb.com' # No Connection:close + with test_support.transient_internet(url): + req = urllib2.urlopen(URL) + res = req.read() + self.assertTrue(res) def _test_urls(self, urls, handlers, retry=True): import time