(self)
| 6369 | |
| 6370 | class 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): |
nothing calls this directly
no test coverage detected