MCPcopy Index your code
hub / github.com/python/cpython / test_delay

Method test_delay

Lib/test/test_logging.py:6349–6357  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

6347
6348class FileHandlerTest(BaseFileTest):
6349 def test_delay(self):
6350 os.unlink(self.fn)
6351 fh = logging.FileHandler(self.fn, encoding='utf-8', delay=True)
6352 self.assertIsNone(fh.stream)
6353 self.assertFalse(os.path.exists(self.fn))
6354 fh.handle(logging.makeLogRecord({}))
6355 self.assertIsNotNone(fh.stream)
6356 self.assertTrue(os.path.exists(self.fn))
6357 fh.close()
6358
6359 def test_emit_after_closing_in_write_mode(self):
6360 # Issue #42378

Callers

nothing calls this directly

Calls 8

closeMethod · 0.95
assertIsNoneMethod · 0.80
assertFalseMethod · 0.80
assertIsNotNoneMethod · 0.80
assertTrueMethod · 0.80
unlinkMethod · 0.45
existsMethod · 0.45
handleMethod · 0.45

Tested by

no test coverage detected