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

Method test_addinivalue_line_new

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

Source from the content-addressed store, hash-verified

784 assert values == ["123", "456"]
785
786 def test_addinivalue_line_new(self, pytester: Pytester) -> None:
787 pytester.makeconftest(
788 """
789 def pytest_addoption(parser):
790 parser.addini("xy", "", type="linelist")
791 """
792 )
793 config = pytester.parseconfig()
794 assert not config.getini("xy")
795 config.addinivalue_line("xy", "456")
796 values = config.getini("xy")
797 assert len(values) == 1
798 assert values == ["456"]
799 config.addinivalue_line("xy", "123")
800 values = config.getini("xy")
801 assert len(values) == 2
802 assert values == ["456", "123"]
803
804 def test_confcutdir_check_isdir(self, pytester: Pytester) -> None:
805 """Give an error if --confcutdir is not a valid directory (#2078)"""

Callers

nothing calls this directly

Calls 4

addinivalue_lineMethod · 0.80
makeconftestMethod · 0.45
parseconfigMethod · 0.45
getiniMethod · 0.45

Tested by

no test coverage detected