Summary
In tests/unit/utils/test_models_dumper.py, the test test_dump_models (and the related fixture usage around lines 67-70) annotates the pytest fixture parameter as Path but receives it via the tmpdir fixture:
def test_dump_models(tmpdir: Path) -> None:
...
filename = tmpdir / "foo.json"
Rationale
The tmpdir fixture returns a py.path.local object, not a pathlib.Path, so the tmpdir: Path type annotation is incorrect and misleading. Modern pytest recommends using the tmp_path fixture, which returns an actual pathlib.Path object, keeping the type annotation accurate and the code aligned with current pytest best practices.
Affected areas
tests/unit/utils/test_models_dumper.py (function test_dump_models, also applies to lines 67-70)
Suggested change
Replace the tmpdir fixture parameter with tmp_path, and update usages accordingly:
def test_dump_models(tmp_path: Path) -> None:
...
filename = tmp_path / "foo.json"
Acceptance criteria
References
Summary
In
tests/unit/utils/test_models_dumper.py, the testtest_dump_models(and the related fixture usage around lines 67-70) annotates the pytest fixture parameter asPathbut receives it via thetmpdirfixture:Rationale
The
tmpdirfixture returns apy.path.localobject, not apathlib.Path, so thetmpdir: Pathtype annotation is incorrect and misleading. Modern pytest recommends using thetmp_pathfixture, which returns an actualpathlib.Pathobject, keeping the type annotation accurate and the code aligned with current pytest best practices.Affected areas
tests/unit/utils/test_models_dumper.py(functiontest_dump_models, also applies to lines 67-70)Suggested change
Replace the
tmpdirfixture parameter withtmp_path, and update usages accordingly:Acceptance criteria
test_dump_modelsuses thetmp_pathfixture instead oftmpdir.Pathmatches the actual fixture return type.References