diff options
author | Stéphane Wirtel <stephane@wirtel.be> | 2019-02-22 13:45:36 (GMT) |
---|---|---|
committer | Victor Stinner <vstinner@redhat.com> | 2019-02-22 13:45:36 (GMT) |
commit | a40681dd5db8deaf05a635eecb91498dac882aa4 (patch) | |
tree | 004360b7e66660aa058dce5e4ca0b3d1c78d8266 /Lib/test/test_urllibnet.py | |
parent | 3208880f1c72800bacf94a2045fcb0436702c7a1 (diff) | |
download | cpython-a40681dd5db8deaf05a635eecb91498dac882aa4.zip cpython-a40681dd5db8deaf05a635eecb91498dac882aa4.tar.gz cpython-a40681dd5db8deaf05a635eecb91498dac882aa4.tar.bz2 |
bpo-36019: Use pythontest.net instead of example.com in network tests (GH-11941)
Diffstat (limited to 'Lib/test/test_urllibnet.py')
-rw-r--r-- | Lib/test/test_urllibnet.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_urllibnet.py b/Lib/test/test_urllibnet.py index 4103b6c..d394ced 100644 --- a/Lib/test/test_urllibnet.py +++ b/Lib/test/test_urllibnet.py @@ -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() |