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

Function test_conftest_found_with_double_dash

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

Source from the content-addressed store, hash-verified

442
443
444def test_conftest_found_with_double_dash(pytester: Pytester) -> None:
445 sub = pytester.mkdir("sub")
446 sub.joinpath("conftest.py").write_text(
447 textwrap.dedent(
448 """\
449 def pytest_addoption(parser):
450 parser.addoption("--hello-world", action="store_true")
451 """
452 )
453 )
454 p = sub.joinpath("test_hello.py")
455 p.write_text("def test_hello(): pass")
456 result = pytester.runpytest(str(p) + "::test_hello", "-h")
457 result.stdout.fnmatch_lines(
458 """
459 *--hello-world*
460 """
461 )
462
463
464class TestConftestVisibility:

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
mkdirMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected