diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2011-04-20 09:58:06 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2011-04-20 09:58:06 (GMT) |
commit | 3def7e0f01aa9706b95947fcd98c9ef693481d00 (patch) | |
tree | afd84eb6801fdd6f0b347a5631f53d4fd764bd3a /Lib | |
parent | 783c82c7013b4bda3f8a20d6d41b2960d59af3e6 (diff) | |
download | cpython-3def7e0f01aa9706b95947fcd98c9ef693481d00.zip cpython-3def7e0f01aa9706b95947fcd98c9ef693481d00.tar.gz cpython-3def7e0f01aa9706b95947fcd98c9ef693481d00.tar.bz2 |
Attempt fix of #11557 by changing teardown logic.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_logging.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index b2e3327..0a7d7d1 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -2414,15 +2414,20 @@ class BasicConfigTest(unittest.TestCase): def setUp(self): super(BasicConfigTest, self).setUp() - handlers = logging.root.handlers - self.addCleanup(lambda: setattr(logging.root, 'handlers', handlers)) + self.handlers = logging.root.handlers + self.addCleanup(self.cleanup) logging.root.handlers = [] def tearDown(self): - logging.shutdown() + for h in logging.root.handlers[:]: + logging.root.removeHandler(h) + h.close() 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): logging.basicConfig() |