@@ -84,7 +84,7 @@ class CloseSocketTest(unittest.TestCase):
8484 def test_close (self ):
8585 # calling .close() on urllib2's response objects should close the
8686 # underlying socket
87- url = "http://www.example.com/"
87+ url = support . TEST_HTTP_URL
8888 with support .transient_internet (url ):
8989 response = _urlopen_with_retry (url )
9090 sock = response .fp
@@ -173,7 +173,7 @@ def test_redirect_url_withfrag(self):
173173 "http://www.pythontest.net/elsewhere/#frag" )
174174
175175 def test_custom_headers (self ):
176- url = "http://www.example.com"
176+ url = support . TEST_HTTP_URL
177177 with support .transient_internet (url ):
178178 opener = urllib .request .build_opener ()
179179 request = urllib .request .Request (url )
@@ -259,15 +259,15 @@ def _extra_handlers(self):
259259class TimeoutTest (unittest .TestCase ):
260260 def test_http_basic (self ):
261261 self .assertIsNone (socket .getdefaulttimeout ())
262- url = "http://www.example.com"
262+ url = support . TEST_HTTP_URL
263263 with support .transient_internet (url , timeout = None ):
264264 u = _urlopen_with_retry (url )
265265 self .addCleanup (u .close )
266266 self .assertIsNone (u .fp .raw ._sock .gettimeout ())
267267
268268 def test_http_default_timeout (self ):
269269 self .assertIsNone (socket .getdefaulttimeout ())
270- url = "http://www.example.com"
270+ url = support . TEST_HTTP_URL
271271 with support .transient_internet (url ):
272272 socket .setdefaulttimeout (60 )
273273 try :
@@ -279,7 +279,7 @@ def test_http_default_timeout(self):
279279
280280 def test_http_no_timeout (self ):
281281 self .assertIsNone (socket .getdefaulttimeout ())
282- url = "http://www.example.com"
282+ url = support . TEST_HTTP_URL
283283 with support .transient_internet (url ):
284284 socket .setdefaulttimeout (60 )
285285 try :
@@ -290,7 +290,7 @@ def test_http_no_timeout(self):
290290 self .assertIsNone (u .fp .raw ._sock .gettimeout ())
291291
292292 def test_http_timeout (self ):
293- url = "http://www.example.com"
293+ url = support . TEST_HTTP_URL
294294 with support .transient_internet (url ):
295295 u = _urlopen_with_retry (url , timeout = 120 )
296296 self .addCleanup (u .close )
0 commit comments