bpo-36019: Use pythontest.net instead of example.com in network tests (GH-11941)

This commit is contained in:
Stéphane Wirtel 2019-02-22 14:45:36 +01:00 committed by Victor Stinner
parent 3208880f1c
commit a40681dd5d
6 changed files with 22 additions and 10 deletions

View file

@ -3,6 +3,7 @@ from test import support
import contextlib
import socket
import urllib.parse
import urllib.request
import os
import email.message
@ -24,8 +25,9 @@ class URLTimeoutTest(unittest.TestCase):
socket.setdefaulttimeout(None)
def testURLread(self):
with support.transient_internet("www.example.com"):
f = urllib.request.urlopen("http://www.example.com/")
domain = urllib.parse.urlparse(support.TEST_HTTP_URL).netloc
with support.transient_internet(domain):
f = urllib.request.urlopen(support.TEST_HTTP_URL)
f.read()