From: Brett Cannon Date: Wed, 14 Mar 2007 21:44:15 +0000 (+0000) Subject: Raise ResourceDenied in test_urllib2net when the Net connection goes bad. X-Git-Tag: v2.6a1~1992 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ea2835a86061d7846f1b8046e79a6aa9140b7ffd;p=thirdparty%2FPython%2Fcpython.git Raise ResourceDenied in test_urllib2net when the Net connection goes bad. --- diff --git a/Lib/test/test_urllib2net.py b/Lib/test/test_urllib2net.py index b27162644237..888a738901cf 100644 --- a/Lib/test/test_urllib2net.py +++ b/Lib/test/test_urllib2net.py @@ -264,7 +264,8 @@ class OtherNetworkTests(unittest.TestCase): (expected_err, url, req, err)) self.assert_(isinstance(err, expected_err), msg) else: - buf = f.read() + with test_support.transient_internet(): + buf = f.read() f.close() debug("read %d bytes" % len(buf)) debug("******** next url coming up...") diff --git a/Misc/NEWS b/Misc/NEWS index f7787615a29d..34b70868c435 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -624,7 +624,8 @@ Extension Modules 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.