[Zodb-checkins] CVS: Zope/lib/python/zLOG/tests - testzLog.py:1.15
Fred L. Drake, Jr.
fred at zope.com
Thu Apr 22 14:52:36 EDT 2004
Update of /cvs-repository/Zope/lib/python/zLOG/tests
In directory cvs.zope.org:/tmp/cvs-serv11639
Modified Files:
testzLog.py
Log Message:
clean some of the cruft out of this test code; it's no longer useful
(the tests themselves still aren't being run; we need decent
save/restore behavior from the logging package to do this properly)
=== Zope/lib/python/zLOG/tests/testzLog.py 1.14 => 1.15 ===
--- Zope/lib/python/zLOG/tests/testzLog.py:1.14 Tue Apr 13 10:28:55 2004
+++ Zope/lib/python/zLOG/tests/testzLog.py Thu Apr 22 14:52:35 2004
@@ -29,26 +29,10 @@
300: 'PANIC',
}
-class StupidLogTest(unittest.TestCase):
- """Test zLOG with the default implementation.
-
- The default implementation uses the environment variables
- STUPID_LOG_FILE and STUPID_LOG_SEVERITY.
- """
- prefix = 'STUPID'
-
- def wipeEnvironment(self):
- if os.environ.has_key('STUPID_LOG_FILE'):
- del os.environ['STUPID_LOG_FILE']
- if os.environ.has_key('EVENT_LOG_FILE'):
- del os.environ['EVENT_LOG_FILE']
- if os.environ.has_key('STUPID_LOG_SEVERITY'):
- del os.environ['STUPID_LOG_SEVERITY']
- if os.environ.has_key('EVENT_LOG_SEVERITY'):
- del os.environ['EVENT_LOG_SEVERITY']
+class EventLogTest(unittest.TestCase):
+ """Test zLOG with the default implementation."""
def setUp(self):
- self.wipeEnvironment()
self.path = tempfile.mktemp()
self._severity = 0
# Windows cannot remove a file that's open. The logging code
@@ -67,7 +51,6 @@
h.close()
del logging._handlers[h]
os.remove(self.path)
- self.wipeEnvironment()
zLOG.initialize()
def setLog(self, severity=0):
@@ -157,15 +140,9 @@
f.close()
-class EventLogTest(StupidLogTest):
- """ Test alternate envvars EVENT_LOG_FILE and EVENT_LOG_SEVERITY """
- prefix = 'EVENT'
-
def test_suite():
return unittest.TestSuite()
- suite = unittest.makeSuite(StupidLogTest, 'check')
- suite.addTest(unittest.makeSuite(EventLogTest, 'check'))
- return suite
+ return unittest.makeSuite(EventLogTest, 'check')
if __name__ == "__main__":
loader = unittest.TestLoader()
More information about the Zodb-checkins
mailing list