| 372 | |
| 373 | |
| 374 | def 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 | |
| 421 | def pytest_configure(config: Config) -> None: |