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

Function pytest_addoption

src/_pytest/junitxml.py:374–418  ·  view source on GitHub ↗
(parser: Parser)

Source from the content-addressed store, hash-verified

372
373
374def pytest_addoption(parser: Parser) -> None:
375 group = parser.getgroup("terminal reporting")
376 group.addoption(
377 "--junitxml",
378 "--junit-xml",
379 action="store",
380 dest="xmlpath",
381 metavar="path",
382 type=functools.partial(filename_arg, optname="--junitxml"),
383 default=None,
384 help="Create junit-xml style report file at given path",
385 )
386 group.addoption(
387 "--junitprefix",
388 "--junit-prefix",
389 action="store",
390 metavar="str",
391 default=None,
392 help="Prepend prefix to classnames in junit-xml output",
393 )
394 parser.addini(
395 "junit_suite_name", "Test suite name for JUnit report", default="pytest"
396 )
397 parser.addini(
398 "junit_logging",
399 "Write captured log messages to JUnit report: "
400 "one of no|log|system-out|system-err|out-err|all",
401 default="no",
402 )
403 parser.addini(
404 "junit_log_passing_tests",
405 "Capture log information for passing tests to JUnit report: ",
406 type="bool",
407 default=True,
408 )
409 parser.addini(
410 "junit_duration_report",
411 "Duration time to report: one of total|call",
412 default="total",
413 ) # choices=['total', 'call'])
414 parser.addini(
415 "junit_family",
416 "Emit XML for schema: one of legacy|xunit1|xunit2",
417 default="xunit2",
418 )
419
420
421def pytest_configure(config: Config) -> None:

Callers

nothing calls this directly

Calls 3

getgroupMethod · 0.80
addiniMethod · 0.80
addoptionMethod · 0.45

Tested by

no test coverage detected