def test_flush(): logger = StdoutLogger(buffer_length=5) logger.enable() logger.record(['test']) assert len(logger._buffer) == 1 logger.flush() assert len(logger._buffer) == 0 logger.record(['test']*5) assert len(logger._buffer) == 5 logger.record(['test']) assert len(logger._buffer) == 0
def test_flush(): logger = StdoutLogger(buffer_length=5) with pytest.warns(DeprecationWarning): logger.open() logger.record(['test']) assert len(logger._buffer) == 1 logger.flush() assert len(logger._buffer) == 0 logger.record(['test']*5) assert len(logger._buffer) == 5 logger.record(['test']) assert len(logger._buffer) == 0