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

Method test_config_getoption

testing/test_config.py:550–560  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

548 assert values[0] == "hello [config]\n"
549
550 def test_config_getoption(self, pytester: Pytester) -> None:
551 pytester.makeconftest(
552 """
553 def pytest_addoption(parser):
554 parser.addoption("--hello", "-X", dest="hello")
555 """
556 )
557 config = pytester.parseconfig("--hello=this")
558 for x in ("hello", "--hello", "-X"):
559 assert config.getoption(x) == "this"
560 pytest.raises(ValueError, config.getoption, "qweqwe")
561
562 def test_config_getoption_unicode(self, pytester: Pytester) -> None:
563 pytester.makeconftest(

Callers

nothing calls this directly

Calls 3

makeconftestMethod · 0.45
parseconfigMethod · 0.45
getoptionMethod · 0.45

Tested by

no test coverage detected