def test__setup_logging_double_verbose_without_log_file(): logging.shutdown() importlib.reload(logging) _setup_logging(2) logger = logging.getLogger("") assert len(logger.handlers) == 1 assert logger.handlers[0].level == logging.DEBUG logging.shutdown() importlib.reload(logging)
def test__setup_logging_quiet_without_log_file(): logging.shutdown() importlib.reload(logging) _setup_logging(-1) logger = logging.getLogger("") assert len(logger.handlers) == 1 assert isinstance(logger.handlers[0], logging.NullHandler) logging.shutdown() importlib.reload(logging)
def test__setup_logging_standard_with_log_file(tmp_path): logging.shutdown() importlib.reload(logging) _setup_logging(log_file=str(tmp_path / "pynguin-test.log"), verbosity=0) logger = logging.getLogger("") assert isinstance(logger, logging.Logger) assert logger.level == logging.DEBUG assert len(logger.handlers) == 2 logging.shutdown() importlib.reload(logging)