This commit is contained in:
Eli Bendersky 2011-05-06 09:31:02 +03:00
commit f804f3a507
1 changed files with 25 additions and 23 deletions

View File

@ -3484,6 +3484,7 @@ class TimedRotatingFileHandlerTest(BaseFileTest):
def test_rollover(self):
fh = logging.handlers.TimedRotatingFileHandler(self.fn, 'S',
backupCount=1)
try:
r = logging.makeLogRecord({'msg': 'testing'})
fh.emit(r)
self.assertLogFile(self.fn)
@ -3506,7 +3507,8 @@ class TimedRotatingFileHandlerTest(BaseFileTest):
for fn in (fn1, fn2):
if os.path.exists(fn):
self.rmfiles.append(fn)
finally:
fh.close()
def test_invalid(self):
assertRaises = self.assertRaises