mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-36019: Use pythontest.net instead of example.com in network tests (GH-11941)
This commit is contained in:
parent
3208880f1c
commit
a40681dd5d
6 changed files with 22 additions and 10 deletions
|
@ -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()
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue