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

Method test_should_not_rollover

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

Source from the content-addressed store, hash-verified

6369
6370class RotatingFileHandlerTest(BaseFileTest):
6371 def test_should_not_rollover(self):
6372 # If file is empty rollover never occurs
6373 rh = logging.handlers.RotatingFileHandler(
6374 self.fn, encoding="utf-8", maxBytes=1)
6375 self.assertFalse(rh.shouldRollover(None))
6376 rh.close()
6377
6378 # If maxBytes is zero rollover never occurs
6379 rh = logging.handlers.RotatingFileHandler(
6380 self.fn, encoding="utf-8", maxBytes=0)
6381 self.assertFalse(rh.shouldRollover(None))
6382 rh.close()
6383
6384 with open(self.fn, 'wb') as f:
6385 f.write(b'\n')
6386 rh = logging.handlers.RotatingFileHandler(
6387 self.fn, encoding="utf-8", maxBytes=0)
6388 self.assertFalse(rh.shouldRollover(None))
6389 rh.close()
6390
6391 @unittest.skipIf(support.is_wasi, "WASI does not have /dev/null.")
6392 def test_should_not_rollover_non_file(self):

Callers

nothing calls this directly

Calls 5

shouldRolloverMethod · 0.95
assertFalseMethod · 0.80
openFunction · 0.50
closeMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected