Commit e546dd84 authored by Vinay Sajip's avatar Vinay Sajip

Attempt fix of #11557 by changing teardown logic.

parent 0cd7388f
...@@ -2414,15 +2414,20 @@ class BasicConfigTest(unittest.TestCase): ...@@ -2414,15 +2414,20 @@ class BasicConfigTest(unittest.TestCase):
def setUp(self): def setUp(self):
super(BasicConfigTest, self).setUp() super(BasicConfigTest, self).setUp()
handlers = logging.root.handlers self.handlers = logging.root.handlers
self.addCleanup(lambda: setattr(logging.root, 'handlers', handlers)) self.addCleanup(self.cleanup)
logging.root.handlers = [] logging.root.handlers = []
def tearDown(self): def tearDown(self):
logging.shutdown() for h in logging.root.handlers[:]:
logging.root.removeHandler(h)
h.close()
super(BasicConfigTest, self).tearDown() super(BasicConfigTest, self).tearDown()
@unittest.skipIf(True, "test disabled, issue #11557") def cleanup(self):
setattr(logging.root, 'handlers', self.handlers)
#@unittest.skipIf(True, "test disabled, issue #11557")
def test_no_kwargs(self): def test_no_kwargs(self):
logging.basicConfig() logging.basicConfig()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment