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
|
Description: skip tests that need Internet.
A number of tests involve the data fetcher which requires Internet to get the
resources. Since this is forbiddent at build time, and discouraged at debci
time, let's skip them altogether. One can tell whether a test needs the
remote resource, because the code to download them is deleted, and thus newly
introduced tests will fail with errors like:
.
E ValueError: File/Folder does not exist
Author: Étienne Mollier <emollier@debian.org>
Forwarded: not-needed
Last-Update: 2023-12-31
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- python-trx-python.orig/trx/tests/test_io.py
+++ python-trx-python/trx/tests/test_io.py
@@ -23,12 +23,10 @@
fetch_data, get_home)
-fetch_data(get_testing_files_dict(), keys=['gold_standard.zip'])
-
-
@pytest.mark.parametrize("path", [("gs.trk"), ("gs.tck"),
("gs.vtk")])
@pytest.mark.skipif(not dipy_available, reason='Dipy is not installed.')
+@pytest.mark.skip(reason='requires gold_standard which needs internet')
def test_seq_ops_sft(path):
with TemporaryDirectory() as tmp_dir:
gs_dir = os.path.join(get_home(), 'gold_standard')
@@ -44,6 +42,7 @@
sft_2 = load_tractogram(os.path.join(tmp_dir, 'tmp.trk'), 'same')
+@pytest.mark.skip(reason='requires gold_standard which needs internet')
def test_seq_ops_trx():
with TemporaryDirectory() as tmp_dir:
gs_dir = os.path.join(get_home(), 'gold_standard')
@@ -59,6 +58,7 @@
@pytest.mark.parametrize("path", [("gs.trx"), ("gs.trk"), ("gs.tck"),
("gs.vtk")])
@pytest.mark.skipif(not dipy_available, reason='Dipy is not installed.')
+@pytest.mark.skip(reason='requires gold_standard which needs internet')
def test_load_vox(path):
gs_dir = os.path.join(get_home(), 'gold_standard')
path = os.path.join(gs_dir, path)
@@ -77,6 +77,7 @@
@pytest.mark.parametrize("path", [("gs.trx"), ("gs.trk"), ("gs.tck"),
("gs.vtk")])
@pytest.mark.skipif(not dipy_available, reason='Dipy is not installed.')
+@pytest.mark.skip(reason='requires gold_standard which needs internet')
def test_load_voxmm(path):
gs_dir = os.path.join(get_home(), 'gold_standard')
path = os.path.join(gs_dir, path)
@@ -94,6 +95,7 @@
@pytest.mark.parametrize("path", [("gs.trk"), ("gs.trx"), ("gs_fldr.trx")])
@pytest.mark.skipif(not dipy_available, reason='Dipy is not installed.')
+@pytest.mark.skip(reason='requires gold_standard which needs internet')
def test_multi_load_save_rasmm(path):
with TemporaryDirectory() as tmp_gs_dir:
gs_dir = os.path.join(get_home(), 'gold_standard')
@@ -120,6 +122,7 @@
@pytest.mark.parametrize("path", [("gs.trx"), ("gs_fldr.trx")])
@pytest.mark.skipif(not dipy_available, reason='Dipy is not installed.')
+@pytest.mark.skip(reason='requires gold_standard which needs internet')
def test_delete_tmp_gs_dir(path):
gs_dir = os.path.join(get_home(), 'gold_standard')
path = os.path.join(gs_dir, path)
@@ -159,6 +162,7 @@
@pytest.mark.parametrize("path", [("gs.trx")])
@pytest.mark.skipif(not dipy_available, reason='Dipy is not installed.')
+@pytest.mark.skip(reason='requires gold_standard which needs internet')
def test_close_tmp_files(path):
gs_dir = os.path.join(get_home(), 'gold_standard')
path = os.path.join(gs_dir, path)
@@ -191,6 +195,7 @@
@pytest.mark.parametrize("tmp_path", [("~"), ("use_working_dir")])
+@pytest.mark.skip(reason='requires gold_standard which needs internet')
def test_change_tmp_dir(tmp_path):
gs_dir = os.path.join(get_home(), 'gold_standard')
path = os.path.join(gs_dir, 'gs.trx')
@@ -213,6 +218,7 @@
@pytest.mark.parametrize("path", [("gs.trx"), ("gs_fldr.trx")])
+@pytest.mark.skip(reason='requires gold_standard which needs internet')
def test_complete_dir_from_trx(path):
gs_dir = os.path.join(get_home(), 'gold_standard')
path = os.path.join(gs_dir, path)
@@ -237,6 +243,7 @@
assert set(file_paths) == set(expected_content)
+@pytest.mark.skip(reason='requires gold_standard which needs internet')
def test_complete_zip_from_trx():
gs_dir = os.path.join(get_home(), 'gold_standard')
path = os.path.join(gs_dir, 'gs.trx')
--- python-trx-python.orig/trx/tests/test_memmap.py
+++ python-trx-python/trx/tests/test_memmap.py
@@ -19,7 +19,6 @@
fetch_data, get_home)
-fetch_data(get_testing_files_dict(), keys=['memmap_test_data.zip'])
tmp_dir = get_trx_tmp_dir()
@@ -156,6 +155,7 @@
("dontexist.trx", False, True),
],
)
+@pytest.mark.skip(reason='requires memmap_test_data which needs internet')
def test_load(path, check_dpg, value_error):
path = os.path.join(get_home(), 'memmap_test_data', path)
# Need to perhaps improve test
@@ -170,18 +170,21 @@
@pytest.mark.parametrize("path", [("small.trx")])
+@pytest.mark.skip(reason='requires memmap_test_data which needs internet')
def test_load_zip(path):
path = os.path.join(get_home(), 'memmap_test_data', path)
assert isinstance(tmm.load_from_zip(path), tmm.TrxFile)
@pytest.mark.parametrize("path", [("small_fldr.trx")])
+@pytest.mark.skip(reason='requires memmap_test_data which needs internet')
def test_load_directory(path):
path = os.path.join(get_home(), 'memmap_test_data', path)
assert isinstance(tmm.load_from_directory(path), tmm.TrxFile)
@pytest.mark.parametrize("path", [("small.trx")])
+@pytest.mark.skip(reason='requires memmap_test_data which needs internet')
def test_concatenate(path):
path = os.path.join(get_home(), 'memmap_test_data', path)
trx1 = tmm.load(path)
@@ -195,6 +198,7 @@
@pytest.mark.parametrize("path", [("small.trx")])
+@pytest.mark.skip(reason='requires memmap_test_data which needs internet')
def test_resize(path):
path = os.path.join(get_home(), 'memmap_test_data', path)
trx1 = tmm.load(path)
@@ -216,6 +220,7 @@
("small.trx", 0)
]
)
+@pytest.mark.skip(reason='requires memmap_test_data which needs internet')
def test_append(path, buffer):
path = os.path.join(get_home(), 'memmap_test_data', path)
trx1 = tmm.load(path)
@@ -233,6 +238,7 @@
@pytest.mark.parametrize("path, buffer", [("small.trx", 10000)])
@pytest.mark.skipif(not dipy_available, reason="Dipy is not installed")
+@pytest.mark.skip(reason='requires memmap_test_data which needs internet')
def test_append_StatefulTractogram(path, buffer):
path = os.path.join(get_home(), 'memmap_test_data', path)
trx = tmm.load(path)
@@ -249,6 +255,7 @@
@pytest.mark.parametrize("path, buffer", [("small.trx", 10000)])
+@pytest.mark.skip(reason='requires memmap_test_data which needs internet')
def test_append_Tractogram(path, buffer):
path = os.path.join(get_home(), 'memmap_test_data', path)
trx = tmm.load(path)
@@ -270,6 +277,7 @@
("small.trx", 50, 0),
("small.trx", 0, 0),
("small.trx", 25000, 10000)])
+@pytest.mark.skip(reason='requires memmap_test_data which needs internet')
def test_from_lazy_tractogram(path, size, buffer):
_ = np.random.RandomState(1776)
streamlines = []
|