Skip to content

Commit

Permalink
Add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
WardBrian committed Oct 11, 2023
1 parent 5a7904e commit 75f7c6a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 75f7c6a

Please sign in to comment.