]> granicus.if.org Git - python/commitdiff
Call unfakehttp in order to close connection while opening the connection through...
authorSenthil Kumaran <orsenthil@gmail.com>
Sat, 19 Mar 2011 21:30:16 +0000 (05:30 +0800)
committerSenthil Kumaran <orsenthil@gmail.com>
Sat, 19 Mar 2011 21:30:16 +0000 (05:30 +0800)
Address issue11609 - urllib related buildbots failure.

Lib/test/test_urllib.py

index 074d833ca47459d8855cda3b9e26b77d8a9c2bc9..e39fa8dfbc450cab2c05e5fa9498949aa6a80c46 100644 (file)
@@ -176,8 +176,11 @@ class urlopen_HttpTests(unittest.TestCase):
 
     def test_willclose(self):
         self.fakehttp(b"HTTP/1.1 200 OK\r\n\r\nHello!")
-        resp = urlopen("http://www.python.org")
-        self.assertTrue(resp.fp.will_close)
+        try:
+            resp = urlopen("http://www.python.org")
+            self.assertTrue(resp.fp.will_close)
+        finally:
+            self.unfakehttp()
 
     def test_read_0_9(self):
         # "0.9" response accepted (but not "simple responses" without