mirror of
https://github.com/python/cpython.git
synced 2026-04-22 03:41:08 +00:00
bpo-36903: Fix ResourceWarning in test_logging (GH-13283) (GH-13285)
(cherry picked from commit 2c10538d11)
Co-authored-by: Xtreak <tir.karthi@gmail.com>
This commit is contained in:
parent
074d7c44a4
commit
744129db5d
1 changed files with 1 additions and 0 deletions
|
|
@ -689,6 +689,7 @@ def emit(self, record):
|
|||
|
||||
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue