Skip to content

Commit

Permalink
Fix pytest.mark typo and associated tmpdir-bug
Browse files Browse the repository at this point in the history
* Fix bug that only occurs when the fixture is actually activated.
* Enforce strict markers
  • Loading branch information
berland committed Sep 3, 2024
1 parent af10631 commit 4c4cadd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[build-system]
requires = ["setuptools", "setuptools_scm", "wheel", "scikit-build", "cmake", "conan<2", "ninja"]

[too.pytest.ini_options]
addopts = "--strict-markers"
6 changes: 3 additions & 3 deletions python/tests/rd_tests/test_rd_sum.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 4c4cadd

Please sign in to comment.