Fix a test causing py38-lsof job failure

This commit is contained in:
Sadra Barikbin 2023-08-05 17:52:53 +03:30
parent 5cb5b1d0e7
commit 9e75ef1277
1 changed files with 17 additions and 17 deletions

View File

@ -40,26 +40,26 @@ class TestParseIni:
tmp_path: Path, tmp_path: Path,
section: str, section: str,
filename: str, filename: str,
monkeypatch: MonkeyPatch,
) -> None: ) -> None:
sub = tmp_path / "sub" sub = tmp_path / "sub"
sub.mkdir() sub.mkdir()
monkeypatch.chdir(sub) with MonkeyPatch.context() as mp:
(tmp_path / filename).write_text( mp.chdir(sub)
textwrap.dedent( (tmp_path / filename).write_text(
"""\ textwrap.dedent(
[{section}] """\
name = value [{section}]
""".format( name = value
section=section """.format(
) section=section
), )
encoding="utf-8", ),
) encoding="utf-8",
_, _, cfg = locate_config([sub]) )
assert cfg["name"] == "value" _, _, cfg = locate_config([sub])
config = pytester.parseconfigure(str(sub)) assert cfg["name"] == "value"
assert config.inicfg["name"] == "value" config = pytester.parseconfigure(str(sub))
assert config.inicfg["name"] == "value"
def test_setupcfg_uses_toolpytest_with_pytest(self, pytester: Pytester) -> None: def test_setupcfg_uses_toolpytest_with_pytest(self, pytester: Pytester) -> None:
p1 = pytester.makepyfile("def test(): pass") p1 = pytester.makepyfile("def test(): pass")