summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_logging.py
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2011-04-20 10:50:56 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2011-04-20 10:50:56 (GMT)
commit95bf50416e428fc266cbadebb89c5d56b6a9cd55 (patch)
tree88e6e824673d7a0d7341ec70a26afa542a8fc139 /Lib/test/test_logging.py
parente07f522c7f570321ef2c069f5fe8b51a5ddb5a7f (diff)
downloadcpython-95bf50416e428fc266cbadebb89c5d56b6a9cd55.zip
cpython-95bf50416e428fc266cbadebb89c5d56b6a9cd55.tar.gz
cpython-95bf50416e428fc266cbadebb89c5d56b6a9cd55.tar.bz2
Attempt fix of #11557 by changing setup/teardown logic.
Diffstat (limited to 'Lib/test/test_logging.py')
-rw-r--r--Lib/test/test_logging.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index 0a7d7d1..d7f9306 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -2410,11 +2410,13 @@ class ModuleLevelMiscTest(BaseTest):
class BasicConfigTest(unittest.TestCase):
- """Tets suite for logging.basicConfig."""
+ """Test suite for logging.basicConfig."""
def setUp(self):
super(BasicConfigTest, self).setUp()
self.handlers = logging.root.handlers
+ self.saved_handlers = logging._handlers.copy()
+ self.saved_handler_list = logging._handlerList[:]
self.addCleanup(self.cleanup)
logging.root.handlers = []
@@ -2426,6 +2428,9 @@ class BasicConfigTest(unittest.TestCase):
def cleanup(self):
setattr(logging.root, 'handlers', self.handlers)
+ logging._handlers.clear()
+ logging._handlers.update(self.saved_handlers)
+ logging._handlerList[:] = self.saved_handler_list
#@unittest.skipIf(True, "test disabled, issue #11557")
def test_no_kwargs(self):