Support reportchars=A (really all, including passed)
This commit is contained in:
parent
a7e49e6c07
commit
b4b9f788af
|
@ -83,7 +83,7 @@ def pytest_addoption(parser):
|
||||||
metavar="chars",
|
metavar="chars",
|
||||||
help="show extra test summary info as specified by chars: (f)ailed, "
|
help="show extra test summary info as specified by chars: (f)ailed, "
|
||||||
"(E)rror, (s)kipped, (x)failed, (X)passed, "
|
"(E)rror, (s)kipped, (x)failed, (X)passed, "
|
||||||
"(p)assed, (P)assed with output, (a)ll except passed (p/P). "
|
"(p)assed, (P)assed with output, (a)ll except passed (p/P), or (A)ll. "
|
||||||
"Warnings are displayed at all times except when "
|
"Warnings are displayed at all times except when "
|
||||||
"--disable-warnings is set.",
|
"--disable-warnings is set.",
|
||||||
)
|
)
|
||||||
|
@ -166,10 +166,13 @@ def getreportopt(config):
|
||||||
reportchars = reportchars.replace("w", "")
|
reportchars = reportchars.replace("w", "")
|
||||||
if reportchars:
|
if reportchars:
|
||||||
for char in reportchars:
|
for char in reportchars:
|
||||||
if char not in reportopts and char != "a":
|
if char == "a":
|
||||||
reportopts += char
|
|
||||||
elif char == "a":
|
|
||||||
reportopts = "sxXwEf"
|
reportopts = "sxXwEf"
|
||||||
|
elif char == "A":
|
||||||
|
reportopts = "sxXwEfpP"
|
||||||
|
break
|
||||||
|
elif char not in reportopts:
|
||||||
|
reportopts += char
|
||||||
return reportopts
|
return reportopts
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -838,6 +838,9 @@ def test_getreportopt():
|
||||||
config.option.disable_warnings = False
|
config.option.disable_warnings = False
|
||||||
assert getreportopt(config) == "sfxw"
|
assert getreportopt(config) == "sfxw"
|
||||||
|
|
||||||
|
config.option.reportchars = "A"
|
||||||
|
assert getreportopt(config) == "sxXwEfpP"
|
||||||
|
|
||||||
|
|
||||||
def test_terminalreporter_reportopt_addopts(testdir):
|
def test_terminalreporter_reportopt_addopts(testdir):
|
||||||
testdir.makeini("[pytest]\naddopts=-rs")
|
testdir.makeini("[pytest]\naddopts=-rs")
|
||||||
|
|
Loading…
Reference in New Issue