]> granicus.if.org Git - python/commitdiff
Raise ResourceDenied in test_urllib2net when the Net connection goes bad.
authorBrett Cannon <bcannon@gmail.com>
Wed, 14 Mar 2007 21:44:15 +0000 (21:44 +0000)
committerBrett Cannon <bcannon@gmail.com>
Wed, 14 Mar 2007 21:44:15 +0000 (21:44 +0000)
Lib/test/test_urllib2net.py
Misc/NEWS

index b27162644237a014f998d6ec8e4ea66bbc2df033..888a738901cfc01075bc7029810aa37dbc41d4bf 100644 (file)
@@ -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...")
index f7787615a29dc3d7de1db1d25c86ed5445eec74b..34b70868c4353473ddf1b2c56830432a4594ce03 100644 (file)
--- 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.