Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pathing problems #260

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions tests/tests/test_unit/test_analyse.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import filecmp
from importlib.resources import files
import os
from pathlib import Path

import pytest
Expand Down Expand Up @@ -37,15 +37,18 @@ def structures_with_points():
def test_get_region_totals(tmp_path, points, structures_with_points):
"""Regression test for get_region_totals for pandas 1.5.3 -> 2.1.3+.
pd.Dataframe.append was deprecated and remove in this time."""
volumes_path = files("cellfinder").joinpath(
"../tests/data/analyse/volumes.csv"
OUTPUT_DATA_LOC = (
Path(os.path.dirname(os.path.abspath(__file__))) / "../../data/analyse"
).resolve()

volumes_path = OUTPUT_DATA_LOC / "volumes.csv"
expected_output = (
OUTPUT_DATA_LOC / "region_totals_regression_pandas1_5_3.csv"
)

output_path = Path(tmp_path / "tmp_region_totals.csv")
get_region_totals(
points, structures_with_points, volumes_path, output_path
)
assert output_path.exists()
expected_output = files("cellfinder").joinpath(
"../tests/data/analyse/region_totals_regression_pandas1_5_3.csv"
)
assert filecmp.cmp(output_path, expected_output)
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ INPUT_COREDEV =
true: coredev

[testenv]
commands = pytest -v --cov=./ --cov-report=xml
commands = pytest {toxinidir} -v --cov=./ --cov-report=xml
deps =
pytest-cov
pytest
Expand Down
Loading