diff --git a/conftest.py b/conftest.py index 272f42303e620cd13fc7f26648bc03d437b1fda6..d6b74818a5d90824dc09ab6faf802ec86e77c1da 100644 --- a/conftest.py +++ b/conftest.py @@ -51,6 +51,7 @@ try: import llvmlite except ImportError: collect_ignore += [os.path.join(SCRIPT_FOLDER, 'pystencils_tests/backends/llvm.py')] + collect_ignore += [os.path.join(SCRIPT_FOLDER, 'pystencils_tests/test_basic_usage_llvm.ipynb')] add_path_to_ignore('pystencils/llvm') try: diff --git a/pystencils_tests/test_jacobi_llvm.py b/pystencils_tests/test_jacobi_llvm.py index 95bd52d2edd706fc3e8b6c595c7ad9855ae5e4f6..953432c11a91616dac17d776a1b1e822ea5f8848 100644 --- a/pystencils_tests/test_jacobi_llvm.py +++ b/pystencils_tests/test_jacobi_llvm.py @@ -1,10 +1,14 @@ -import numpy as np + import pytest +try: + from pystencils.llvm.llvmjit import generate_and_jit + from pystencils.llvm import create_kernel, make_python_function + from pystencils.cpu.cpujit import get_llc_command + from pystencils import Assignment, Field, show_code + import numpy as np +except ModuleNotFoundError: + pytest.importorskip("llvmlite") -from pystencils import Assignment, Field, show_code -from pystencils.cpu.cpujit import get_llc_command -from pystencils.llvm import create_kernel, make_python_function -from pystencils.llvm.llvmjit import generate_and_jit def test_jacobi_fixed_field_size(): diff --git a/pystencils_tests/test_size_and_layout_checks_llvm.py b/pystencils_tests/test_size_and_layout_checks_llvm.py index 8de8018f99f5be73dc899b6a649fc4d3a5e1923a..278ad1f20453a431f5f25c870c647332b16269b3 100644 --- a/pystencils_tests/test_size_and_layout_checks_llvm.py +++ b/pystencils_tests/test_size_and_layout_checks_llvm.py @@ -1,7 +1,11 @@ import numpy as np +import pytest from pystencils import Assignment, Field -from pystencils.llvm import create_kernel, make_python_function +try: + from pystencils.llvm import create_kernel, make_python_function +except ModuleNotFoundError: + pytest.importorskip("llvmlite") def test_size_check(): diff --git a/pystencils_tests/test_sliced_iteration.py b/pystencils_tests/test_sliced_iteration.py index 1749745684872e75c199602b281e9622c02a257b..761cae3f2a994d1df40738be756248fa50902e95 100644 --- a/pystencils_tests/test_sliced_iteration.py +++ b/pystencils_tests/test_sliced_iteration.py @@ -30,6 +30,8 @@ def test_sliced_iteration(): def test_sliced_iteration_llvm(): + import pytest + pytest.importorskip("llvmlite") size = (4, 4) src_arr = np.ones(size) dst_arr = np.zeros_like(src_arr)