From 3a8158071929ad1a1e58d1540dab21d44b2fdb61 Mon Sep 17 00:00:00 2001 From: Senthil Kumaran Date: Mon, 22 Oct 2012 17:06:43 -0700 Subject: Fix the ResourceWarning in test_urllib.py due changes made for #16301. Patch by Berker Peksag --- Lib/test/test_urllib.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py index e2d306f..276568d 100644 --- a/Lib/test/test_urllib.py +++ b/Lib/test/test_urllib.py @@ -280,7 +280,8 @@ Content-Type: text/html; charset=iso-8859-1 tmp_fileurl = 'file://localhost' + tmp_file self.assertTrue(os.path.exists(tmp_file)) - self.assertTrue(urlopen(tmp_fileurl)) + with urlopen(tmp_fileurl) as fobj: + self.assertTrue(fobj) os.unlink(tmp_file) self.assertFalse(os.path.exists(tmp_file)) -- cgit v0.12