Remove OutputVerbosity.verbose
This commit is contained in:
parent
1e918147ea
commit
b8714de594
|
@ -1705,16 +1705,6 @@ class OutputVerbosity:
|
|||
def __init__(self, config: Config) -> None:
|
||||
self._config = config
|
||||
|
||||
@property
|
||||
def verbose(self) -> int:
|
||||
"""
|
||||
Application wide verbosity level.
|
||||
|
||||
Same as the traditional ``config.getoption("verbose")``.
|
||||
"""
|
||||
assert isinstance(self._config.option.verbose, int)
|
||||
return self._config.option.verbose
|
||||
|
||||
def get(self, verbosity_type: VerbosityType = VerbosityType.Global) -> int:
|
||||
"""Return verbosity level for the given output type.
|
||||
|
||||
|
@ -1725,7 +1715,9 @@ class OutputVerbosity:
|
|||
level = self._config.getini(OutputVerbosity._ini_name(verbosity_type))
|
||||
|
||||
if level == OutputVerbosity.DEFAULT:
|
||||
return self.verbose
|
||||
assert isinstance(self._config.option.verbose, int)
|
||||
return self._config.option.verbose
|
||||
|
||||
return int(level)
|
||||
|
||||
@staticmethod
|
||||
|
|
|
@ -2196,23 +2196,6 @@ class TestOutputVerbosity:
|
|||
parser, TestOutputVerbosity.SOME_OUTPUT_TYPE, help="some help text"
|
||||
)
|
||||
|
||||
def test_verbose_matches_option_verbose(
|
||||
self, pytester: Pytester, tmp_path: Path
|
||||
) -> None:
|
||||
tmp_path.joinpath("pytest.ini").write_text(
|
||||
textwrap.dedent(
|
||||
"""\
|
||||
[pytest]
|
||||
addopts = --verbose
|
||||
"""
|
||||
),
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
config = pytester.parseconfig(tmp_path)
|
||||
|
||||
assert config.option.verbose == config.output_verbosity.verbose
|
||||
|
||||
def test_level_matches_verbose_when_not_specified(
|
||||
self, pytester: Pytester, tmp_path: Path
|
||||
) -> None:
|
||||
|
@ -2231,7 +2214,7 @@ class TestOutputVerbosity:
|
|||
|
||||
assert (
|
||||
config.output_verbosity.get(TestOutputVerbosity.SOME_OUTPUT_TYPE)
|
||||
== config.output_verbosity.verbose
|
||||
== config.option.verbose
|
||||
)
|
||||
|
||||
def test_level_matches_specified_override(
|
||||
|
|
Loading…
Reference in New Issue