Commit ea2835a8 authored by Brett Cannon's avatar Brett Cannon

Raise ResourceDenied in test_urllib2net when the Net connection goes bad.

parent ed001842
...@@ -264,7 +264,8 @@ class OtherNetworkTests(unittest.TestCase): ...@@ -264,7 +264,8 @@ class OtherNetworkTests(unittest.TestCase):
(expected_err, url, req, err)) (expected_err, url, req, err))
self.assert_(isinstance(err, expected_err), msg) self.assert_(isinstance(err, expected_err), msg)
else: else:
buf = f.read() with test_support.transient_internet():
buf = f.read()
f.close() f.close()
debug("read %d bytes" % len(buf)) debug("read %d bytes" % len(buf))
debug("******** next url coming up...") debug("******** next url coming up...")
......
...@@ -624,7 +624,8 @@ Extension Modules ...@@ -624,7 +624,8 @@ Extension Modules
Tests Tests
----- -----
- Capture and silence socket connection resets and timeouts in test_socket_ssl. - Capture socket connection resets and timeouts in test_socket_ssl and
test_urllib2net and raise test.test_support.ResourceDenied.
- Patch #1559413: Fix test_cmd_line if sys.executable contains a space. - Patch #1559413: Fix test_cmd_line if sys.executable contains a space.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment