diff options
author | Senthil Kumaran <orsenthil@gmail.com> | 2011-03-19 21:30:16 (GMT) |
---|---|---|
committer | Senthil Kumaran <orsenthil@gmail.com> | 2011-03-19 21:30:16 (GMT) |
commit | acbaa923b8d17b439bef139df7806d44ac027a44 (patch) | |
tree | 1f663f269d4cc17a7f85e8e0ea924e14bf777fe4 /Lib/test/test_urllib.py | |
parent | d24c991f11541ccdb3cddade4a59ae0d2c0908bd (diff) | |
download | cpython-acbaa923b8d17b439bef139df7806d44ac027a44.zip cpython-acbaa923b8d17b439bef139df7806d44ac027a44.tar.gz cpython-acbaa923b8d17b439bef139df7806d44ac027a44.tar.bz2 |
Call unfakehttp in order to close connection while opening the connection through a fakehttp object.
Address issue11609 - urllib related buildbots failure.
Diffstat (limited to 'Lib/test/test_urllib.py')
-rw-r--r-- | Lib/test/test_urllib.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py index 074d833..e39fa8d 100644 --- a/Lib/test/test_urllib.py +++ b/Lib/test/test_urllib.py @@ -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 |