Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e8c276c

Browse filesBrowse files
authored
Merge pull request #113 from ruaridhg/fig_test_slice
Fig test slice
2 parents b02b001 + 4c47f40 commit e8c276c
Copy full SHA for e8c276c

File tree

7 files changed

+17
-7
lines changed
Filter options

7 files changed

+17
-7
lines changed

‎.gitignore

Copy file name to clipboardExpand all lines: .gitignore
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ pip-delete-this-directory.txt
3737
# Unit test / coverage reports
3838
htmlcov/
3939
.tox/
40+
report/
4041
.coverage
4142
.coverage.*
4243
.cache

‎setup.cfg

Copy file name to clipboardExpand all lines: setup.cfg
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ docs =
5555
sphinx-gallery
5656
testing =
5757
napari[pyqt6-experimental]
58+
pooch
5859
pyqt6
5960
pytest
6061
pytest-cov

‎src/napari_matplotlib/base.py

Copy file name to clipboardExpand all lines: src/napari_matplotlib/base.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import napari
66
from matplotlib.axes import Axes
7-
from matplotlib.backends.backend_qt5agg import (
7+
from matplotlib.backends.backend_qtagg import (
88
FigureCanvas,
99
NavigationToolbar2QT,
1010
)
Loading

‎src/napari_matplotlib/tests/conftest.py

Copy file name to clipboardExpand all lines: src/napari_matplotlib/tests/conftest.py
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,8 @@ def image_data(request):
1717
@pytest.fixture
1818
def astronaut_data():
1919
return data.astronaut(), {"rgb": True}
20+
21+
22+
@pytest.fixture
23+
def brain_data():
24+
return data.brain(), {"rgb": False}
+6-5Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import numpy as np
1+
import pytest
22

33
from napari_matplotlib import SliceWidget
44

55

6-
def test_scatter(make_napari_viewer):
7-
# Smoke test adding a histogram widget
6+
@pytest.mark.mpl_image_compare
7+
def test_slice(make_napari_viewer, brain_data):
88
viewer = make_napari_viewer()
9-
viewer.add_image(np.random.random((100, 100, 100)))
10-
SliceWidget(viewer)
9+
viewer.add_image(brain_data[0], **brain_data[1])
10+
fig = SliceWidget(viewer).figure
11+
return fig

‎tox.ini

Copy file name to clipboardExpand all lines: tox.ini
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ python =
1111

1212
[testenv]
1313
extras = testing
14-
commands = python -m pytest --mpl -v --color=yes --cov=napari_matplotlib --cov-report=xml
14+
commands =
15+
- python -c 'from skimage import data; data.brain()'
16+
- python -m pytest --mpl -v --color=yes --cov=napari_matplotlib --cov-report=xml

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.