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

Method test_addini_bool

testing/test_config.py:744–762  ·  view source on GitHub ↗
(
        self, pytester: Pytester, str_val: str, bool_val: bool
    )

Source from the content-addressed store, hash-verified

742 "str_val, bool_val", [("True", True), ("no", False), ("no-ini", True)]
743 )
744 def test_addini_bool(
745 self, pytester: Pytester, str_val: str, bool_val: bool
746 ) -> None:
747 pytester.makeconftest(
748 """
749 def pytest_addoption(parser):
750 parser.addini("strip", "", type="bool", default=True)
751 """
752 )
753 if str_val != "no-ini":
754 pytester.makeini(
755 """
756 [pytest]
757 strip=%s
758 """
759 % str_val
760 )
761 config = pytester.parseconfig()
762 assert config.getini("strip") is bool_val
763
764 def test_addinivalue_line_existing(self, pytester: Pytester) -> None:
765 pytester.makeconftest(

Callers

nothing calls this directly

Calls 4

makeconftestMethod · 0.45
makeiniMethod · 0.45
parseconfigMethod · 0.45
getiniMethod · 0.45

Tested by

no test coverage detected