MCPcopy
hub / github.com/pytest-dev/pytest / getreportopt

Function getreportopt

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

Source from the content-addressed store, hash-verified

306
307
308def getreportopt(config: Config) -> str:
309 reportchars: str = config.option.reportchars
310
311 old_aliases = {"F", "S"}
312 reportopts = ""
313 for char in reportchars:
314 if char in old_aliases:
315 char = char.lower()
316 if char == "a":
317 reportopts = "sxXEf"
318 elif char == "A":
319 reportopts = "PpsxXEf"
320 elif char == "N":
321 reportopts = ""
322 elif char not in reportopts:
323 reportopts += char
324
325 if not config.option.disable_warnings and "w" not in reportopts:
326 reportopts = "w" + reportopts
327 elif config.option.disable_warnings and "w" in reportopts:
328 reportopts = reportopts.replace("w", "")
329
330 return reportopts
331
332
333@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