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

Add a regression test for generate_clean_orientation_image function #1

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Install Windows OpenGL
if: runner.os == 'Windows'
run: |
git clone --depth 1 git://github.com/pyvista/gl-ci-helpers.git
git clone --depth 1 https://github.com/pyvista/gl-ci-helpers.git
powershell gl-ci-helpers/appveyor/install_opengl.ps1

# note: if you need dependencies from conda, considering using
Expand Down
File renamed without changes.
Binary file added _tests/liver_example.tif
Binary file not shown.
Binary file added _tests/liver_example_cleaned.tif
Binary file not shown.
13 changes: 13 additions & 0 deletions _tests/test_function.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import numpy as np
from skimage.io import imread
from pathlib import Path

ROOT_DIR = Path(__file__).parent


def test_generate_clean_orientation_image():
image = imread(ROOT_DIR / "liver_example.tif")
from napari_polo import generate_clean_orientation_image
result = generate_clean_orientation_image(image)
expected = imread(ROOT_DIR / "liver_example_cleaned.tif")
assert np.allclose(result, expected, atol=0.001)
3 changes: 0 additions & 3 deletions napari_polo/_tests/test_function.py

This file was deleted.

4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ platform =
passenv =
CI
GITHUB_ACTIONS
DISPLAY XAUTHORITY
DISPLAY
XAUTHORITY
NUMPY_EXPERIMENTAL_ARRAY_FUNCTION
PYVISTA_OFF_SCREEN
deps =
Expand All @@ -32,4 +33,5 @@ deps =
# you can remove these if you don't use them
qtpy
pyqt5
scikit-image
commands = pytest -v --color=yes --cov=napari_polo --cov-report=xml