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

Function test_required_option_help

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

Source from the content-addressed store, hash-verified

681
682
683def test_required_option_help(pytester: Pytester) -> None:
684 pytester.makeconftest("assert 0")
685 x = pytester.mkdir("x")
686 x.joinpath("conftest.py").write_text(
687 textwrap.dedent(
688 """\
689 def pytest_addoption(parser):
690 parser.addoption("--xyz", action="store_true", required=True)
691 """
692 )
693 )
694 result = pytester.runpytest("-h", x)
695 result.stdout.no_fnmatch_line("*argument --xyz is required*")
696 assert "general:" in result.stdout.str()

Callers

nothing calls this directly

Calls 5

no_fnmatch_lineMethod · 0.80
strMethod · 0.80
makeconftestMethod · 0.45
mkdirMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected