MCPcopy Create free account
hub / github.com/pytest-dev/pytest / getreportopt

Function getreportopt

src/_pytest/terminal.py:239–261  ·  view source on GitHub ↗
(config: Config)

Source from the content-addressed store, hash-verified

237
238
239def getreportopt(config: Config) -> str:
240 reportchars: str = config.option.reportchars
241
242 old_aliases = {"F", "S"}
243 reportopts = ""
244 for char in reportchars:
245 if char in old_aliases:
246 char = char.lower()
247 if char == "a":
248 reportopts = "sxXEf"
249 elif char == "A":
250 reportopts = "PpsxXEf"
251 elif char == "N":
252 reportopts = ""
253 elif char not in reportopts:
254 reportopts += char
255
256 if not config.option.disable_warnings and "w" not in reportopts:
257 reportopts = "w" + reportopts
258 elif config.option.disable_warnings and "w" in reportopts:
259 reportopts = reportopts.replace("w", "")
260
261 return reportopts
262
263
264@hookimpl(trylast=True) # after _pytest.runner

Callers 2

test_getreportoptFunction · 0.90
__init__Method · 0.85

Calls

no outgoing calls

Tested by 1

test_getreportoptFunction · 0.72