From 2c10538d11fa9be9a1a9f21605861e10ec4fa207 Mon Sep 17 00:00:00 2001 From: Xtreak Date: Mon, 13 May 2019 20:18:52 +0530 Subject: bpo-36903: Fix ResourceWarning in test_logging (GH-13283) --- Lib/test/test_logging.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index bc99c3a..b884753 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -684,6 +684,7 @@ class HandlerTest(BaseTest): self.assertEqual(len(logging._handlers), 0) refed_h = _OurHandler() + self.addCleanup(refed_h.sub_handler.stream.close) refed_h.name = 'because we need at least one for this test' self.assertGreater(len(logging._handlers), 0) self.assertGreater(len(logging._at_fork_reinit_lock_weakset), 1) -- cgit v0.12