From 91bfcab9dd6566cac8971bdf85c1457f6a513434 Mon Sep 17 00:00:00 2001 From: Patrick Lannigan Date: Sun, 12 Nov 2023 20:08:12 -0500 Subject: [PATCH] Test case for unknown verbosity type --- testing/test_config.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/testing/test_config.py b/testing/test_config.py index b85e7e4a3..58671e6ed 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -2279,6 +2279,24 @@ class TestVerbosity: == config.option.verbose ) + def test_level_matches_verbose_when_not_known_type( + self, pytester: Pytester, tmp_path: Path + ) -> None: + tmp_path.joinpath("pytest.ini").write_text( + textwrap.dedent( + """\ + [pytest] + addopts = --verbose + """ + ), + encoding="utf-8", + ) + pytester.plugins = [TestVerbosity.VerbosityIni()] + + config = pytester.parseconfig(tmp_path) + + assert config.get_verbosity("some fake verbosity type") == config.option.verbose + def test_level_matches_specified_override( self, pytester: Pytester, tmp_path: Path ) -> None: