Kaydet (Commit) 89c8862e authored tarafından Vinay Sajip's avatar Vinay Sajip

Close handler opened in test.

üst 1c7b7f7f
......@@ -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
......
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