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

Function test_conftest_existing_junitxml

testing/test_conftest.py:364–376  ·  view source on GitHub ↗
(pytester: Pytester)

Source from the content-addressed store, hash-verified

362
363
364def test_conftest_existing_junitxml(pytester: Pytester) -> None:
365 x = pytester.mkdir("tests")
366 x.joinpath("conftest.py").write_text(
367 textwrap.dedent(
368 """\
369 def pytest_addoption(parser):
370 parser.addoption("--xyz", action="store_true")
371 """
372 )
373 )
374 pytester.makefile(ext=".xml", junit="") # Writes junit.xml
375 result = pytester.runpytest("-h", "--junitxml", "junit.xml")
376 result.stdout.fnmatch_lines(["*--xyz*"])
377
378
379def test_conftest_import_order(pytester: Pytester, monkeypatch: MonkeyPatch) -> None:

Callers

nothing calls this directly

Calls 4

fnmatch_linesMethod · 0.80
mkdirMethod · 0.45
makefileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected