Skip to content

Commit

Permalink
add test for UserWarning raised
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobEliasWagner committed Feb 21, 2024
1 parent 4c5eb61 commit 589eb1b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/transforms/test_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ def test_transform_undo(plus_one_transform, random_tensor):


def test_transform_undo_not_bijective(abs_transform, random_tensor):
assert torch.allclose(abs_transform.undo(random_tensor), random_tensor)
with pytest.warns(UserWarning) as record:
assert torch.allclose(abs_transform.undo(random_tensor), random_tensor)
assert len(record) == 1

0 comments on commit 589eb1b

Please sign in to comment.