mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Closes issue11563 test_urllibnet is triggering a ResourceWarning. Patch by Jeff McNeil.
This commit is contained in:
commit
a4d5b0cb62
2 changed files with 12 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue