From de8243ee0ac94ca1e09f81cf3130c691324abd4a Mon Sep 17 00:00:00 2001 From: Tomáš Jusko Date: Tue, 19 Dec 2023 03:06:47 +0100 Subject: Fixed skipping tests when CUDA is not available --- test/sca/test_stacked_combine.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/sca/test_stacked_combine.py b/test/sca/test_stacked_combine.py index 68d422c..7941b46 100644 --- a/test/sca/test_stacked_combine.py +++ b/test/sca/test_stacked_combine.py @@ -25,9 +25,7 @@ def samples(): class Base: @pytest.fixture() - def gpu_manager(self, samples): - if not cuda.is_available(): - pytest.skip("CUDA not available") + def gpu_manager(self): raise NotImplementedError("Subclasses should implement this") def test_average(self, samples, gpu_manager): @@ -89,12 +87,16 @@ class Base: class TestNonChunked(Base): @pytest.fixture() def gpu_manager(self, samples): + if not cuda.is_available(): + pytest.skip("CUDA not available") return GPUTraceManager(StackedTraces(samples), TPB) class TestChunked(Base): @pytest.fixture() def gpu_manager(self, samples): + if not cuda.is_available(): + pytest.skip("CUDA not available") return GPUTraceManager(StackedTraces(samples), TPB, chunk_size=CHUNK_SIZE, -- cgit v1.3.1