Skip to content

Commit 0396fff

Browse files
authored
Merge pull request #696 from mrava87/patch-test_torch_skip
minor: use pytest.skip instead of return in test_torchoperator
2 parents cbd7d1b + d104cd4 commit 0396fff

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

pytests/test_torchoperator.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from numpy.testing import assert_array_equal
1212

1313
backend = "numpy"
14-
import numpy as npp
1514
import pytest
1615
import torch
1716

@@ -33,7 +32,7 @@ def test_TorchOperator(par):
3332
# temporarily, skip tests on mac as torch seems not to recognized
3433
# numpy when v2 is installed
3534
if platform.system() == "Darwin":
36-
return
35+
pytest.skip("torch not recognized on macOS with numpy v2")
3736
device = "cpu" if backend == "numpy" else "cuda"
3837

3938
Dop = MatrixMult(np.random.normal(0.0, 1.0, (par["ny"], par["nx"])))
@@ -63,7 +62,7 @@ def test_TorchOperator_batch(par):
6362
# temporarily, skip tests on mac as torch seems not to recognized
6463
# numpy when v2 is installed
6564
if platform.system() == "Darwin":
66-
return
65+
pytest.skip("torch not recognized on macOS with numpy v2")
6766
device = "cpu" if backend == "numpy" else "cuda"
6867

6968
Dop = MatrixMult(np.random.normal(0.0, 1.0, (par["ny"], par["nx"])))
@@ -85,7 +84,7 @@ def test_TorchOperator_batch_nd(par):
8584
# temporarily, skip tests on mac as torch seems not to recognized
8685
# numpy when v2 is installed
8786
if platform.system() == "Darwin":
88-
return
87+
pytest.skip("torch not recognized on macOS with numpy v2")
8988
device = "cpu" if backend == "numpy" else "cuda"
9089

9190
Dop = MatrixMult(np.random.normal(0.0, 1.0, (par["ny"], par["nx"])), otherdims=(2,))

0 commit comments

Comments
 (0)