diff options
author | Bernát Gábor <bgabor8@bloomberg.net> | 2022-01-10 08:04:33 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-10 08:04:33 +0000 |
commit | 6607e2cf43c17141838c11f964474ae1225b641b (patch) | |
tree | 535b933cb7fb1a7d8e51ff9540e6020c23791e6c /tests/config | |
parent | 6c53d99e0e5fb221580ff4c509e295f194fbd926 (diff) | |
download | tox-git-6607e2cf43c17141838c11f964474ae1225b641b.tar.gz |
Fix double clean package and broken report (#2309)
Diffstat (limited to 'tests/config')
-rw-r--r-- | tests/config/cli/test_parse.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/config/cli/test_parse.py b/tests/config/cli/test_parse.py index 5309f2bf..c635ac89 100644 --- a/tests/config/cli/test_parse.py +++ b/tests/config/cli/test_parse.py @@ -1,9 +1,12 @@ from __future__ import annotations +import logging + import pytest from tox.config.cli.parse import get_options from tox.pytest import CaptureFixture +from tox.report import LowerInfoLevel def test_help_does_not_default_cmd(capsys: CaptureFixture) -> None: @@ -13,3 +16,25 @@ def test_help_does_not_default_cmd(capsys: CaptureFixture) -> None: assert not err assert "--verbose" in out assert "subcommands:" in out + + +def test_verbosity_guess_miss_match(capsys: CaptureFixture) -> None: + result = get_options("-rv") + assert result.parsed.verbosity == 3 + + assert logging.getLogger().level == logging.INFO + + for name in ("distlib.util", "filelock"): + logger = logging.getLogger(name) + for logging_filter in logger.filters: # pragma: no branch # never empty + if isinstance(logging_filter, LowerInfoLevel): # pragma: no branch # we always find it + assert logging_filter.level == logging.INFO + break + + logging.error("E") + logging.warning("W") + logging.info("I") + logging.debug("D") + + out, err = capsys.readouterr() + assert out == "ROOT: E\nROOT: W\nROOT: I\n" |