File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
src/napari_matplotlib/tests Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 11import os
22from pathlib import Path
3+ from typing import Any , Dict , Tuple
34
45import numpy as np
6+ import numpy .typing as npt
57import pytest
68from skimage import data
79
@@ -18,7 +20,7 @@ def image_data(request):
1820
1921
2022@pytest .fixture
21- def astronaut_data ():
23+ def astronaut_data () -> Tuple [ npt . NDArray [ Any ], Dict [ Any , Any ]] :
2224 return data .astronaut (), {"rgb" : True }
2325
2426
Original file line number Diff line number Diff line change 99def test_slice_3D (make_napari_viewer , brain_data ):
1010 viewer = make_napari_viewer ()
1111 viewer .theme = "light"
12+
13+ data = brain_data [0 ]
14+ assert data .ndim == 3
1215 viewer .add_image (brain_data [0 ], ** brain_data [1 ])
16+
1317 axis = viewer .dims .last_used
1418 slice_no = brain_data [0 ].shape [0 ] - 1
1519 viewer .dims .set_current_step (axis , slice_no )
@@ -23,7 +27,11 @@ def test_slice_3D(make_napari_viewer, brain_data):
2327def test_slice_2D (make_napari_viewer , astronaut_data ):
2428 viewer = make_napari_viewer ()
2529 viewer .theme = "light"
30+
31+ data = astronaut_data [0 ]
32+ assert data .ndim == 2
2633 viewer .add_image (astronaut_data [0 ], ** astronaut_data [1 ])
34+
2735 fig = SliceWidget (viewer ).figure
2836 # Need to return a copy, as original figure is too eagerley garbage
2937 # collected by the widget
You can’t perform that action at this time.
0 commit comments