Don't interpret negative verbosity as debug (#86318)
* Don't interpret negative verbosity as debug CI run with -qq which is a negative verbosity * Make sure all caplog tests get debug level * Update tests/conftest.py Co-authored-by: Erik Montnemery <erik@montnemery.com> Co-authored-by: Erik Montnemery <erik@montnemery.com>pull/86341/head^2
parent
ca4d7634a8
commit
53b931e21a
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue