[Python-checkins] cpython (3.2): Call unfakehttp in order to close connection while opening the connection

senthil.kumaran python-checkins at python.org
Sat Mar 19 22:34:30 CET 2011


http://hg.python.org/cpython/rev/5c83a375a23e
changeset:   68688:5c83a375a23e
branch:      3.2
parent:      68677:d84896ba7576
user:        Senthil Kumaran <orsenthil at gmail.com>
date:        Sun Mar 20 05:30:16 2011 +0800
summary:
  Call unfakehttp in order to close connection while opening the connection through a fakehttp object.
Address issue11609 - urllib related buildbots failure.

files:
  Lib/test/test_urllib.py

diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py
--- a/Lib/test/test_urllib.py
+++ b/Lib/test/test_urllib.py
@@ -176,8 +176,11 @@
 
     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

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list