diff options
author | Senthil Kumaran <orsenthil@gmail.com> | 2011-03-19 09:47:26 (GMT) |
---|---|---|
committer | Senthil Kumaran <orsenthil@gmail.com> | 2011-03-19 09:47:26 (GMT) |
commit | a4d5b0cb620d8dfc07623f4fe2b551257217589d (patch) | |
tree | 3ed334961542acadc356a96f16942d92204aefd8 /Lib/test/test_urllib.py | |
parent | f95b4df6d2a73b0e3d6c57215c677c6dd9d95410 (diff) | |
parent | d24c991f11541ccdb3cddade4a59ae0d2c0908bd (diff) | |
download | cpython-a4d5b0cb620d8dfc07623f4fe2b551257217589d.zip cpython-a4d5b0cb620d8dfc07623f4fe2b551257217589d.tar.gz cpython-a4d5b0cb620d8dfc07623f4fe2b551257217589d.tar.bz2 |
Closes issue11563 test_urllibnet is triggering a ResourceWarning. Patch by Jeff McNeil.
Diffstat (limited to 'Lib/test/test_urllib.py')
-rw-r--r-- | Lib/test/test_urllib.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py index 420ff1c..d510e49 100644 --- a/Lib/test/test_urllib.py +++ b/Lib/test/test_urllib.py @@ -91,7 +91,7 @@ class urlopen_FileTests(unittest.TestCase): "did not return the expected text") def test_close(self): - # Test close() by calling it hear and then having it be called again + # Test close() by calling it here and then having it be called again # by the tearDown() method for the test self.returned_obj.close() @@ -174,6 +174,11 @@ class urlopen_HttpTests(unittest.TestCase): finally: self.unfakehttp() + 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) + def test_read_0_9(self): # "0.9" response accepted (but not "simple responses" without # a status line) |