(pytester: pytest.Pytester)
| 140 | |
| 141 | |
| 142 | def test_override_ini_paths(pytester: pytest.Pytester) -> None: |
| 143 | pytester.makeconftest( |
| 144 | """ |
| 145 | def pytest_addoption(parser): |
| 146 | parser.addini("paths", "my new ini value", type="pathlist")""" |
| 147 | ) |
| 148 | pytester.makeini( |
| 149 | """ |
| 150 | [pytest] |
| 151 | paths=blah.py""" |
| 152 | ) |
| 153 | pytester.makepyfile( |
| 154 | r""" |
| 155 | def test_overriden(pytestconfig): |
| 156 | config_paths = pytestconfig.getini("paths") |
| 157 | print(config_paths) |
| 158 | for cpf in config_paths: |
| 159 | print('\nuser_path:%s' % cpf.basename) |
| 160 | """ |
| 161 | ) |
| 162 | result = pytester.runpytest("--override-ini", "paths=foo/bar1.py foo/bar2.py", "-s") |
| 163 | result.stdout.fnmatch_lines(["user_path:bar1.py", "user_path:bar2.py"]) |
| 164 | |
| 165 | |
| 166 | def test_inifile_from_cmdline_main_hook(pytester: pytest.Pytester) -> None: |
nothing calls this directly
no test coverage detected