mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-128734: Fix ResourceWarning in urllib tests (GH-128735)
This commit is contained in:
parent
cb72feb8a3
commit
5ace71713b
5 changed files with 40 additions and 20 deletions
|
@ -48,6 +48,7 @@ class TestResponse(unittest.TestCase):
|
|||
info = urllib.response.addinfo(self.fp, self.test_headers)
|
||||
self.assertEqual(info.info(), self.test_headers)
|
||||
self.assertEqual(info.headers, self.test_headers)
|
||||
info.close()
|
||||
|
||||
def test_addinfourl(self):
|
||||
url = "http://www.python.org"
|
||||
|
@ -60,6 +61,7 @@ class TestResponse(unittest.TestCase):
|
|||
self.assertEqual(infourl.headers, self.test_headers)
|
||||
self.assertEqual(infourl.url, url)
|
||||
self.assertEqual(infourl.status, code)
|
||||
infourl.close()
|
||||
|
||||
def tearDown(self):
|
||||
self.sock.close()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue