From 452dd974cceef5457291345b592f81ef718f008a Mon Sep 17 00:00:00 2001 From: bloodearnest Date: Mon, 13 Jan 2025 18:08:31 +0000 Subject: [PATCH] Disable legacy tmpdir fixture And fix two tests that used it. --- pyproject.toml | 2 +- tests/functional/test_dump_example_data.py | 6 +++--- tests/functional/test_graph_query.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e4bb4cfc0..fec419ebd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,7 +64,7 @@ add_ignore = [ ] [tool.pytest.ini_options] -addopts = "--tb=native --strict-markers --dist=loadgroup" +addopts = "--tb=native --strict-markers --dist=loadgroup -p no:legacypath" testpaths = ["tests"] filterwarnings = [ # ignnore dbapi() deprecation warnings for the third party TrinoDialect that we subclass diff --git a/tests/functional/test_dump_example_data.py b/tests/functional/test_dump_example_data.py index 60029aa02..9e57bd9cf 100644 --- a/tests/functional/test_dump_example_data.py +++ b/tests/functional/test_dump_example_data.py @@ -1,8 +1,8 @@ import contextlib -def test_dump_example_data(call_cli, tmpdir): - with contextlib.chdir(tmpdir): +def test_dump_example_data(call_cli, tmp_path): + with contextlib.chdir(tmp_path): call_cli("dump-example-data") - filenames = [path.basename for path in (tmpdir / "example-data").listdir()] + filenames = [path.name for path in (tmp_path / "example-data").iterdir()] assert "patients.csv" in filenames diff --git a/tests/functional/test_graph_query.py b/tests/functional/test_graph_query.py index 7995a6d48..537a33e36 100644 --- a/tests/functional/test_graph_query.py +++ b/tests/functional/test_graph_query.py @@ -11,8 +11,8 @@ shutil.which("dot") is None, reason="Graphing requires Graphviz library", ) -def test_graph_query(call_cli, tmpdir): # pragma: no cover - output_file = tmpdir / "query.svg" +def test_graph_query(call_cli, tmp_path): # pragma: no cover + output_file = tmp_path / "query.svg" call_cli( "graph-query", FIXTURES_PATH / "dataset_definition.py",