From e9605ab21870922a9c047cb3006b44b1cc6fba14 Mon Sep 17 00:00:00 2001 From: Stephan Seitz <stephan.seitz@fau.de> Date: Fri, 18 Oct 2019 14:31:22 +0200 Subject: [PATCH] Skip OpenCL tests that require pycuda if pycuda is not installed --- pystencils_tests/test_opencl.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pystencils_tests/test_opencl.py b/pystencils_tests/test_opencl.py index 2917d0dae..adffeb475 100644 --- a/pystencils_tests/test_opencl.py +++ b/pystencils_tests/test_opencl.py @@ -40,6 +40,8 @@ def test_print_opencl(): @pytest.mark.skipif(not HAS_OPENCL, reason="Test requires pyopencl") def test_opencl_jit_fixed_size(): + pytest.importorskip('pycuda') + z, y, x = pystencils.fields("z, y, x: [20,30]") assignments = pystencils.AssignmentCollection({ @@ -92,6 +94,8 @@ def test_opencl_jit_fixed_size(): @pytest.mark.skipif(not HAS_OPENCL, reason="Test requires pyopencl") def test_opencl_jit(): + pytest.importorskip('pycuda') + z, y, x = pystencils.fields("z, y, x: [2d]") assignments = pystencils.AssignmentCollection({ @@ -144,6 +148,8 @@ def test_opencl_jit(): @pytest.mark.skipif(not HAS_OPENCL, reason="Test requires pyopencl") def test_opencl_jit_with_parameter(): + pytest.importorskip('pycuda') + z, y, x = pystencils.fields("z, y, x: [2d]") a = sp.Symbol('a') -- GitLab