From 75f7c6a54179d53d443cc2617b0c36f28ea29bd6 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Wed, 11 Oct 2023 16:56:32 -0400 Subject: [PATCH] Add a test --- tests/test_errors.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_errors.py b/tests/test_errors.py index a64353c..701f7a6 100644 --- a/tests/test_errors.py +++ b/tests/test_errors.py @@ -157,3 +157,14 @@ def test_t1_negative_output_dims() -> None: ValueError, match="Got output_shape that was not positive integer" ): pytorch_finufft.functional.finufft_type1.apply(points, values, (10, -2)) + +# dependencies +def test_cuda_finufft_not_installed(): + pytest.importorskip("finufft") + + points = torch.rand(10, dtype=torch.float64).to('cpu') + values = torch.randn(10, dtype=torch.complex128).to('cpu') + + with pytest.raises(RuntimeError, match="cufinufft failed to import"): + pytorch_finufft.functional.finufft_type1.apply(points, values, 10) +