summaryrefslogtreecommitdiff
path: root/Lib/test/test_logging.py
diff options
context:
space:
mode:
authorXtreak <tir.karthi@gmail.com>2019-05-13 20:18:52 +0530
committerVictor Stinner <vstinner@redhat.com>2019-05-13 16:48:51 +0200
commit2c10538d11fa9be9a1a9f21605861e10ec4fa207 (patch)
tree65fc3f67ef6a315c2b81250dcc3411cd7c8c7c0c /Lib/test/test_logging.py
parentc1f7262f7013074613805347db2276f8b5e0e3a4 (diff)
downloadcpython-git-2c10538d11fa9be9a1a9f21605861e10ec4fa207.tar.gz
bpo-36903: Fix ResourceWarning in test_logging (GH-13283)
Diffstat (limited to 'Lib/test/test_logging.py')
-rw-r--r--Lib/test/test_logging.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index bc99c3adbe..b884753ad3 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)