From 5eb7c4c8572d070b8a8dea161f2cf7791b0932cd Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 11 Oct 2021 21:53:54 -0400 Subject: [PATCH] Disable showing log capture when `--ll` is passed --- tests/conftest.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 347cc7d..060050d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -74,7 +74,15 @@ def pytest_configure(config): @pytest.fixture(scope='session', autouse=True) def loglevel(request): orig = tractor.log._default_loglevel - level = tractor.log._default_loglevel = request.config.option.loglevel + + level_from_cli = request.config.option.loglevel + # disable built-in capture when user passes the `--ll` value + # presuming they already know they want to see console logging + # and don't need it repeated by pytest. + if level_from_cli: + request.config.option.showcapture = 'no' + + level = tractor.log._default_loglevel = level_from_cli yield level tractor.log._default_loglevel = orig