Skip to content

Commit

Permalink
Compatibility with pytest 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DradeAW committed Jan 31, 2024
1 parent a77b0c9 commit a037b23
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ def pipeline(data: LussacData) -> LussacPipeline:
return LussacPipeline(data)


def pytest_collection_modifyitems(session: pytest.Session, config: pytest.Config, items: list[pytest.Item]) -> None:
# test "test_dataset_exists" has to be run first!
for item in items.copy():
if item.parent.name == "test_main.py":
items.remove(item)
items.insert(0, item)


def pytest_sessionstart(session: pytest.Session) -> None:
# Remove lussac folder if exists.
shutil.rmtree("tests/datasets/cerebellar_cortex/lussac", ignore_errors=True)
Expand Down

0 comments on commit a037b23

Please sign in to comment.