Skip to content

Commit 4488b9e

Browse files
committed
feat: add --report-chars long option and its corresponding test
1 parent 64e3c91 commit 4488b9e

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/_pytest/terminal.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ def pytest_addoption(parser: Parser) -> None:
189189
)
190190
group._addoption( # private to use reserved lower-case short option
191191
"-r",
192+
"--report-chars",
192193
action="store",
193194
dest="reportchars",
194195
default=_REPORTCHARS_DEFAULT,

testing/test_config.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,14 @@ def test_append_parse_args(
9797
assert config.option.tbstyle == "short"
9898
assert config.option.verbose
9999

100+
def test_report_chars_long_option(
101+
self, pytester: Pytester, tmp_path: Path, monkeypatch: MonkeyPatch
102+
) -> None:
103+
"""Test that --report-chars is parsed correctly."""
104+
monkeypatch.setenv("PYTEST_ADDOPTS", '--report-chars=fE')
105+
config = pytester.parseconfig(tmp_path)
106+
assert config.option.reportchars == "fE"
107+
100108
def test_tox_ini_wrong_version(self, pytester: Pytester) -> None:
101109
pytester.makefile(
102110
".ini",

0 commit comments

Comments
 (0)