[3.7] bpo-36019: Use pythontest.net instead of example.com in network tests (GH-11941) by miss-islington · Pull Request #11989 · python/cpython
def test_custom_headers(self): url = "http://www.example.com" url = support.TEST_HTTP_URL with support.transient_internet(url): opener = urllib.request.build_opener() request = urllib.request.Request(url)
def test_http_default_timeout(self): self.assertIsNone(socket.getdefaulttimeout()) url = "http://www.example.com" url = support.TEST_HTTP_URL with support.transient_internet(url): socket.setdefaulttimeout(60) try:
def test_http_no_timeout(self): self.assertIsNone(socket.getdefaulttimeout()) url = "http://www.example.com" url = support.TEST_HTTP_URL with support.transient_internet(url): socket.setdefaulttimeout(60) try:
def test_http_timeout(self): url = "http://www.example.com" url = support.TEST_HTTP_URL with support.transient_internet(url): u = _urlopen_with_retry(url, timeout=120) self.addCleanup(u.close)