diff options
Diffstat (limited to 'Lib/test/test_urllib2net.py')
-rw-r--r-- | Lib/test/test_urllib2net.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Lib/test/test_urllib2net.py b/Lib/test/test_urllib2net.py index e2b1d95..7f3c93a 100644 --- a/Lib/test/test_urllib2net.py +++ b/Lib/test/test_urllib2net.py @@ -83,12 +83,13 @@ class CloseSocketTest(unittest.TestCase): def test_close(self): # calling .close() on urllib2's response objects should close the # underlying socket - - response = _urlopen_with_retry("http://www.python.org/") - sock = response.fp - self.assertTrue(not sock.closed) - response.close() - self.assertTrue(sock.closed) + url = "http://www.python.org/" + with support.transient_internet(url): + response = _urlopen_with_retry(url) + sock = response.fp + self.assertTrue(not sock.closed) + response.close() + self.assertTrue(sock.closed) class OtherNetworkTests(unittest.TestCase): def setUp(self): |