(
self,
pytester: Pytester,
tmp_path: Path,
section: str,
filename: str,
monkeypatch: MonkeyPatch,
)
| 41 | "section, filename", [("pytest", "pytest.ini"), ("tool:pytest", "setup.cfg")] |
| 42 | ) |
| 43 | def test_getcfg_and_config( |
| 44 | self, |
| 45 | pytester: Pytester, |
| 46 | tmp_path: Path, |
| 47 | section: str, |
| 48 | filename: str, |
| 49 | monkeypatch: MonkeyPatch, |
| 50 | ) -> None: |
| 51 | sub = tmp_path / "sub" |
| 52 | sub.mkdir() |
| 53 | monkeypatch.chdir(sub) |
| 54 | (tmp_path / filename).write_text( |
| 55 | textwrap.dedent( |
| 56 | f"""\ |
| 57 | [{section}] |
| 58 | name = value |
| 59 | """ |
| 60 | ), |
| 61 | encoding="utf-8", |
| 62 | ) |
| 63 | _, _, cfg, _ = locate_config(Path.cwd(), [sub]) |
| 64 | assert cfg["name"] == ConfigValue("value", origin="file", mode="ini") |
| 65 | config = pytester.parseconfigure(str(sub)) |
| 66 | assert config._inicfg["name"] == ConfigValue("value", origin="file", mode="ini") |
| 67 | |
| 68 | def test_setupcfg_uses_toolpytest_with_pytest(self, pytester: Pytester) -> None: |
| 69 | p1 = pytester.makepyfile("def test(): pass") |
nothing calls this directly
no test coverage detected