(self, pytester: Pytester, config_type: str)
| 866 | |
| 867 | @pytest.mark.parametrize("config_type", ["ini", "pyproject"]) |
| 868 | def test_addini_paths(self, pytester: Pytester, config_type: str) -> None: |
| 869 | pytester.makeconftest( |
| 870 | """ |
| 871 | def pytest_addoption(parser): |
| 872 | parser.addini("paths", "my new ini value", type="paths") |
| 873 | parser.addini("abc", "abc value") |
| 874 | """ |
| 875 | ) |
| 876 | if config_type == "ini": |
| 877 | inipath = pytester.makeini( |
| 878 | """ |
| 879 | [pytest] |
| 880 | paths=hello world/sub.py |
| 881 | """ |
| 882 | ) |
| 883 | elif config_type == "pyproject": |
| 884 | inipath = pytester.makepyprojecttoml( |
| 885 | """ |
| 886 | [tool.pytest.ini_options] |
| 887 | paths=["hello", "world/sub.py"] |
| 888 | """ |
| 889 | ) |
| 890 | config = pytester.parseconfig() |
| 891 | values = config.getini("paths") |
| 892 | assert len(values) == 2 |
| 893 | assert values[0] == inipath.parent.joinpath("hello") |
| 894 | assert values[1] == inipath.parent.joinpath("world/sub.py") |
| 895 | with pytest.raises(ValueError): |
| 896 | config.getini("other") |
| 897 | |
| 898 | def make_conftest_for_args(self, pytester: Pytester) -> None: |
| 899 | pytester.makeconftest( |
nothing calls this directly
no test coverage detected