From 4c4cadd6f76b8821763ab9da6494312e018ea28f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Berland?= Date: Mon, 2 Sep 2024 22:04:30 +0200 Subject: [PATCH] Fix pytest.mark typo and associated tmpdir-bug * Fix bug that only occurs when the fixture is actually activated. * Enforce strict markers --- pyproject.toml | 3 +++ python/tests/rd_tests/test_rd_sum.py | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9abf16845..90bff08a3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,5 @@ [build-system] requires = ["setuptools", "setuptools_scm", "wheel", "scikit-build", "cmake", "conan<2", "ninja"] + +[too.pytest.ini_options] +addopts = "--strict-markers" diff --git a/python/tests/rd_tests/test_rd_sum.py b/python/tests/rd_tests/test_rd_sum.py index 08653c7f6..80db52bc9 100644 --- a/python/tests/rd_tests/test_rd_sum.py +++ b/python/tests/rd_tests/test_rd_sum.py @@ -159,12 +159,12 @@ def test_labscale(self): @pytest.fixture def use_tmpdir(tmpdir): - with tmpdir.as_wcd(): + with tmpdir.as_cwd(): yield @given(summaries()) -@pytest.mark.use_fixtures("use_tmpdir") +@pytest.mark.usefixtures("use_tmpdir") def test_to_from_pandas(summary): smspec, unsmry = summary assume(len(smspec.keywords) == len(set(smspec.keywords))) @@ -193,7 +193,7 @@ def test_to_from_pandas(summary): @given(summaries()) -@pytest.mark.use_fixtures("use_tmpdir") +@pytest.mark.usefixtures("use_tmpdir") def test_that_non_matching_dataframe_gives_empty_columns(summary): smspec, unsmry = summary assume("BOGUS" not in (smspec.keywords))