Skip to content

Commit f840fc5

Browse files
authored
remove decorator double negative (#1490)
Signed-off-by: Richard Brown <[email protected]>
1 parent 2eada01 commit f840fc5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ def skip_if_no_cpp_extention(obj):
8585
"""
8686
Skip the unit tests if the cpp extention isnt available
8787
"""
88-
return unittest.skipIf(not USE_COMPILED, "Skipping cpp extention tests")(obj)
88+
return unittest.skipUnless(USE_COMPILED, "Skipping cpp extention tests")(obj)
8989

9090

9191
def skip_if_no_cuda(obj):
9292
"""
9393
Skip the unit tests if torch.cuda.is_available is False
9494
"""
95-
return unittest.skipIf(not torch.cuda.is_available(), "Skipping CUDA-based tests")(obj)
95+
return unittest.skipUnless(torch.cuda.is_available(), "Skipping CUDA-based tests")(obj)
9696

9797

9898
def skip_if_windows(obj):

0 commit comments

Comments
 (0)