bpo-36903: Fix ResourceWarning in test_logging (GH-13283)

This commit is contained in:
Xtreak 2019-05-13 20:18:52 +05:30 committed by Victor Stinner
parent c1f7262f70
commit 2c10538d11

View file

@ -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)