Skip to content

Commit 55d49ce

Browse files
committed
skip all ocl tests when not available
1 parent 8eb1b27 commit 55d49ce

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

pytissueoptics/rayscattering/tests/opencl/config/testCLConfig.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import unittest
44
from unittest.mock import patch
55

6+
from pytissueoptics.rayscattering.opencl import OPENCL_OK
67
from pytissueoptics.rayscattering.opencl.config import CLConfig as clc
78

89

@@ -16,6 +17,7 @@ def wrapper(*args, **kwargs):
1617
return wrapper
1718

1819

20+
@unittest.skipIf(not OPENCL_OK, 'OpenCL device not available.')
1921
class TestCLConfig(unittest.TestCase):
2022
@tempConfigPath
2123
def testGivenNoConfigFile_shouldWarnAndCreateANewOne(self):

pytissueoptics/rayscattering/tests/opencl/testCLPhotons.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
from pytissueoptics import ScatteringScene, ScatteringMaterial, EnergyLogger, Cube
66
from pytissueoptics.rayscattering.opencl.CLPhotons import CLPhotons
77
from pytissueoptics.scene.geometry import Environment
8-
from pytissueoptics.rayscattering.opencl import WEIGHT_THRESHOLD
8+
from pytissueoptics.rayscattering.opencl import WEIGHT_THRESHOLD, OPENCL_OK
99
from pytissueoptics.scene.logger import InteractionKey
1010

1111

12+
@unittest.skipIf(not OPENCL_OK, 'OpenCL device not available.')
1213
class TestCLPhotons(unittest.TestCase):
1314
def testWhenPropagateWithoutContext_shouldNotPropagate(self):
1415
positions = np.array([[0, 0, 0], [0, 0, 0]])

0 commit comments

Comments
 (0)