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

Method test_confcutdir_check_isdir

testing/test_config.py:804–814  ·  view source on GitHub ↗

Give an error if --confcutdir is not a valid directory (#2078)

(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

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)"""
806 exp_match = r"^--confcutdir must be a directory, given: "
807 with pytest.raises(pytest.UsageError, match=exp_match):
808 pytester.parseconfig("--confcutdir", pytester.path.joinpath("file"))
809 with pytest.raises(pytest.UsageError, match=exp_match):
810 pytester.parseconfig("--confcutdir", pytester.path.joinpath("nonexistent"))
811
812 p = pytester.mkdir("dir")
813 config = pytester.parseconfig("--confcutdir", p)
814 assert config.getoption("confcutdir") == str(p)
815
816 @pytest.mark.parametrize(
817 "names, expected",

Callers

nothing calls this directly

Calls 3

parseconfigMethod · 0.45
mkdirMethod · 0.45
getoptionMethod · 0.45

Tested by

no test coverage detected