Commit 18a4bf3b authored by Tim Peters's avatar Tim Peters

test_with_logfile(): This was leaving a temp file behind.

parent ad9b6c9d
...@@ -107,6 +107,7 @@ class TestzLOGConfig(unittest.TestCase): ...@@ -107,6 +107,7 @@ class TestzLOGConfig(unittest.TestCase):
zLOG.LogHandlers.NullHandler)) zLOG.LogHandlers.NullHandler))
def test_with_logfile(self): def test_with_logfile(self):
import os
fn = tempfile.mktemp() fn = tempfile.mktemp()
logger = self.check_simple_logger("<eventlog>\n" logger = self.check_simple_logger("<eventlog>\n"
" <logfile>\n" " <logfile>\n"
...@@ -117,6 +118,8 @@ class TestzLOGConfig(unittest.TestCase): ...@@ -117,6 +118,8 @@ class TestzLOGConfig(unittest.TestCase):
logfile = logger.handlers[0] logfile = logger.handlers[0]
self.assertEqual(logfile.level, logging.DEBUG) self.assertEqual(logfile.level, logging.DEBUG)
self.assert_(isinstance(logfile, zLOG.LogHandlers.FileHandler)) self.assert_(isinstance(logfile, zLOG.LogHandlers.FileHandler))
logfile.close()
os.remove(fn)
def test_with_stderr(self): def test_with_stderr(self):
self.check_standard_stream("stderr") self.check_standard_stream("stderr")
......
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