[Zope3-checkins] CVS: Zope/lib/python/ZConfig/components/logger/tests - test_logger.py:1.2

Fred L. Drake, Jr. fred at zope.com
Fri Apr 9 17:22:00 EDT 2004


Update of /cvs-repository/Zope/lib/python/ZConfig/components/logger/tests
In directory cvs.zope.org:/tmp/cvs-serv28631/ZConfig/components/logger/tests

Modified Files:
	test_logger.py 
Log Message:
Change the mapping from zLOG to the logging package:
- don't dump everything into the "event" logger;
  use the subsystem argument to zLOG.LOG to get a specific logger
- move some comments into docstrings


=== Zope/lib/python/ZConfig/components/logger/tests/test_logger.py 1.1 => 1.2 ===
--- Zope/lib/python/ZConfig/components/logger/tests/test_logger.py:1.1	Fri Jan  2 13:46:14 2004
+++ Zope/lib/python/ZConfig/components/logger/tests/test_logger.py	Fri Apr  9 17:21:59 2004
@@ -27,16 +27,17 @@
 from ZConfig.components.logger import loghandler
 
 
-class TestConfig(unittest.TestCase):
+class LoggingTestBase(unittest.TestCase):
 
     # XXX This tries to save and restore the state of logging around
     # the test.  Somewhat surgical; there may be a better way.
 
     def setUp(self):
-        self._old_logger = logging.getLogger("event")
+        self._old_logger = logging.getLogger()
         self._old_level = self._old_logger.level
         self._old_handlers = self._old_logger.handlers[:]
         self._old_logger.handlers[:] = [loghandler.NullHandler()]
+        self._old_logger.setLevel(logging.WARN)
 
     def tearDown(self):
         for h in self._old_logger.handlers:
@@ -44,6 +45,9 @@
         for h in self._old_handlers:
             self._old_logger.addHandler(h)
         self._old_logger.setLevel(self._old_level)
+
+
+class TestConfig(LoggingTestBase):
 
     _schema = None
     _schematext = """




More information about the Zope3-Checkins mailing list