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

Function pytest_addoption

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

Source from the content-addressed store, hash-verified

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