1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
|
From: Ole Streicher <olebole@debian.org>
Date: Wed, 16 Dec 2020 11:26:58 +0100
Subject: Skip tests that need the python3-pooch package and internet
connection
python3-pooch is not available yet (RFS #968470)
---
skimage/data/tests/test_data.py | 16 ++++++++++++++++
skimage/filters/rank/tests/test_rank.py | 3 +--
skimage/measure/tests/test_blur_effect.py | 1 +
skimage/morphology/tests/test_gray.py | 4 ++++
.../tests/test_masked_phase_cross_correlation.py | 1 +
.../registration/tests/test_phase_cross_correlation.py | 1 +
skimage/restoration/tests/test_restoration.py | 1 +
skimage/restoration/tests/test_rolling_ball.py | 1 +
8 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/skimage/data/tests/test_data.py b/skimage/data/tests/test_data.py
index 301306c..663bbc6 100644
--- a/skimage/data/tests/test_data.py
+++ b/skimage/data/tests/test_data.py
@@ -7,6 +7,15 @@ import os
import pytest
+@pytest.mark.skip(reason="test fails without pooch")
+def test_data_dir():
+ # data_dir should be a directory people can use as a standard directory
+ # https://github.com/scikit-image/scikit-image/pull/3945#issuecomment-498141893
+ data_dir = data.data_dir
+ assert 'astronaut.png' in os.listdir(data_dir)
+
+
+@pytest.mark.skip(reason="requires data downloaded from internet")
def test_download_all_with_pooch():
# jni first wrote this test with the intention of
# fully deleting the files in the data_dir,
@@ -62,6 +71,7 @@ def test_coffee():
data.coffee()
+@pytest.mark.skip(reason="requires data downloaded from internet")
def test_eagle():
"""Test that "eagle" image can be loaded."""
# Fetching the data through the testing module will
@@ -137,6 +147,7 @@ def test_lfw_subset():
data.lfw_subset()
+@pytest.mark.skip(reason="Needs python3-pooch and internet connection")
def test_skin():
"""Test that "skin" image can be loaded.
@@ -151,6 +162,7 @@ def test_cell():
data.cell()
+@pytest.mark.skip(reason="requires data downloaded from internet")
def test_cells3d():
"""Needs internet connection."""
path = fetch('data/cells3d.tif')
@@ -158,6 +170,7 @@ def test_cells3d():
assert image.shape == (60, 2, 256, 256)
+@pytest.mark.skip(reason="requires data downloaded from internet")
def test_brain_3d():
"""Needs internet connection."""
path = fetch('data/brain.tiff')
@@ -165,6 +178,7 @@ def test_brain_3d():
assert image.shape == (10, 256, 256)
+@pytest.mark.skip(reason="requires data downloaded from internet")
def test_kidney_3d_multichannel():
"""Test that 3D multichannel image of kidney tissue can be loaded.
@@ -175,6 +189,7 @@ def test_kidney_3d_multichannel():
assert kidney.shape == (16, 512, 512, 3)
+@pytest.mark.skip(reason="requires data downloaded from internet")
def test_lily_multichannel():
"""Test that microscopy image of lily of the valley can be loaded.
@@ -185,6 +200,7 @@ def test_lily_multichannel():
assert lily.shape == (922, 922, 4)
+@pytest.mark.skip(reason="requires data downloaded from internet")
def test_vortex():
fetch('data/pivchallenge-B-B001_1.tif')
fetch('data/pivchallenge-B-B001_2.tif')
diff --git a/skimage/filters/rank/tests/test_rank.py b/skimage/filters/rank/tests/test_rank.py
index 2f82c8b..5758bbd 100644
--- a/skimage/filters/rank/tests/test_rank.py
+++ b/skimage/filters/rank/tests/test_rank.py
@@ -58,7 +58,6 @@ def test_subtract_mean_underflow_correction(dtype):
# Note: Explicitly read all values into a dict. Otherwise, stochastic test
# failures related to I/O can occur during parallel test cases.
ref_data = dict(np.load(fetch("data/rank_filter_tests.npz")))
-ref_data_3d = dict(np.load(fetch('data/rank_filters_tests_3d.npz')))
@pytest.mark.parametrize(
@@ -104,7 +103,6 @@ class TestRank:
self.footprint = morphology.disk(1)
self.footprint_3d = morphology.ball(1)
self.refs = ref_data
- self.refs_3d = ref_data_3d
@pytest.mark.parametrize('outdt', [None, np.float32, np.float64])
@pytest.mark.parametrize('filter', all_rank_filters)
@@ -158,6 +156,7 @@ class TestRank:
@pytest.mark.parametrize('outdt', [None, np.float32, np.float64])
@pytest.mark.parametrize('filter', _3d_rank_filters)
+ @pytest.mark.skip(reason="requires data downloaded from internet")
def test_rank_filters_3D(self, filter, outdt):
@run_in_parallel(warnings_matching=['Possible precision loss'])
def check():
diff --git a/skimage/measure/tests/test_blur_effect.py b/skimage/measure/tests/test_blur_effect.py
index bfd622b..e126435 100644
--- a/skimage/measure/tests/test_blur_effect.py
+++ b/skimage/measure/tests/test_blur_effect.py
@@ -44,6 +44,7 @@ def test_blur_effect_channel_axis():
np.testing.assert_array_equal(B0_arr, B1_arr)
+@pytest.mark.skip(reason="Needs python3-pooch and internet connection")
def test_blur_effect_3d():
"""Test that the blur metric works on a 3D image."""
image_3d = ski.data.cells3d()[:, 1, :, :] # grab just the nuclei
diff --git a/skimage/morphology/tests/test_gray.py b/skimage/morphology/tests/test_gray.py
index 7073f22..e392c85 100644
--- a/skimage/morphology/tests/test_gray.py
+++ b/skimage/morphology/tests/test_gray.py
@@ -67,6 +67,8 @@ class TestMorphology:
return output
+
+ @pytest.mark.skip(reason="requires data downloaded from internet")
def test_gray_morphology(self):
expected = dict(np.load(fetch('data/gray_morph_output.npz')))
calculated = self._build_expected_output()
@@ -449,6 +451,7 @@ def test_octagon_decomposition(cam_image, function, m, n, decomposition):
assert_array_equal(expected, out)
+@pytest.mark.skip(reason="requires data downloaded from internet")
@pytest.mark.parametrize(
"function",
["erosion", "dilation", "closing", "opening", "white_tophat", "black_tophat"],
@@ -468,6 +471,7 @@ def test_cube_decomposition(cell3d_image, function, shape, decomposition):
assert_array_equal(expected, out)
+@pytest.mark.skip(reason="requires data downloaded from internet")
@pytest.mark.parametrize(
"function",
["erosion", "dilation", "closing", "opening", "white_tophat", "black_tophat"],
diff --git a/skimage/registration/tests/test_masked_phase_cross_correlation.py b/skimage/registration/tests/test_masked_phase_cross_correlation.py
index 8e0fb79..37f174d 100644
--- a/skimage/registration/tests/test_masked_phase_cross_correlation.py
+++ b/skimage/registration/tests/test_masked_phase_cross_correlation.py
@@ -59,6 +59,7 @@ def test_masked_registration_random_masks():
assert_equal(measured_shift, -np.array(shift))
+@pytest.mark.skip(reason="Needs python3-pooch and internet connection")
def test_masked_registration_3d_contiguous_mask():
"""masked_register_translation should be able to register translations
between volumes with contiguous masks."""
diff --git a/skimage/registration/tests/test_phase_cross_correlation.py b/skimage/registration/tests/test_phase_cross_correlation.py
index a43f14f..4f2181e 100644
--- a/skimage/registration/tests/test_phase_cross_correlation.py
+++ b/skimage/registration/tests/test_phase_cross_correlation.py
@@ -177,6 +177,7 @@ def test_mismatch_offsets_size():
_upsampled_dft(np.ones((4, 4)), 3, axis_offsets=[3, 2, 1, 4])
+@pytest.mark.skip(reason="requires data downloaded from internet")
@pytest.mark.parametrize(
('shift0', 'shift1'),
itertools.product((100, -100, 350, -350), (100, -100, 350, -350)),
diff --git a/skimage/restoration/tests/test_restoration.py b/skimage/restoration/tests/test_restoration.py
index 6b7de49..ef71891 100644
--- a/skimage/restoration/tests/test_restoration.py
+++ b/skimage/restoration/tests/test_restoration.py
@@ -164,6 +164,7 @@ def test_richardson_lucy(ndim):
@pytest.mark.parametrize('dtype_image', [np.float16, np.float32, np.float64])
@pytest.mark.parametrize('dtype_psf', [np.float32, np.float64])
+@pytest.mark.skip(reason="requires data downloaded from internet")
def test_richardson_lucy_filtered(dtype_image, dtype_psf):
if dtype_image == np.float64:
atol = 1e-8
diff --git a/skimage/restoration/tests/test_rolling_ball.py b/skimage/restoration/tests/test_rolling_ball.py
index 42f4e57..58a2b1f 100644
--- a/skimage/restoration/tests/test_rolling_ball.py
+++ b/skimage/restoration/tests/test_rolling_ball.py
@@ -90,6 +90,7 @@ def test_threads(num_threads):
rolling_ball(img, radius=10, nansafe=True, num_threads=num_threads)
+@pytest.mark.skip(reason="Needs python3-pooch and internet connection")
def test_ndim():
image = data.cells3d()[:5, 1, ...]
kernel = ellipsoid_kernel((3, 100, 100), 100)
|