diff --git a/tests/conftest.py b/tests/conftest.py index a3a4c8eb113..606e8194def 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -99,7 +99,7 @@ def pytest_configure(config): config.addinivalue_line( "markers", "no_fail_on_log_exception: mark test to not fail on logged exception" ) - if config.getoption("verbose"): + if config.getoption("verbose") > 0: logging.basicConfig(level=logging.DEBUG) else: logging.basicConfig(level=logging.INFO) @@ -201,6 +201,13 @@ location.async_detect_location_info = check_real(location.async_detect_location_ util.get_local_ip = lambda: "127.0.0.1" +@pytest.fixture(name="caplog") +def caplog_fixture(caplog): + """Set log level to debug for tests using the caplog fixture.""" + caplog.set_level(logging.DEBUG) + yield caplog + + @pytest.fixture(autouse=True, scope="module") def garbage_collection(): """Run garbage collection at known locations.