diff options
| author | Stéphane Wirtel <stephane@wirtel.be> | 2019-02-22 14:45:36 +0100 |
|---|---|---|
| committer | Victor Stinner <vstinner@redhat.com> | 2019-02-22 14:45:36 +0100 |
| commit | a40681dd5db8deaf05a635eecb91498dac882aa4 (patch) | |
| tree | 004360b7e66660aa058dce5e4ca0b3d1c78d8266 /Lib/test/test_urllibnet.py | |
| parent | 3208880f1c72800bacf94a2045fcb0436702c7a1 (diff) | |
| download | cpython-git-a40681dd5db8deaf05a635eecb91498dac882aa4.tar.gz | |
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 4103b6c075..d394ceddd0 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() |
