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