11import numba
22import numpy as np
3- import pytest
43
54from stumpy import fastmath
65
7- if numba .config .DISABLE_JIT :
8- pytest .skip ("Skipping Tests JIT is disabled" , allow_module_level = True )
9-
106
117def test_set ():
128 # The test is done by changing the value of fastmath flag for
@@ -21,7 +17,10 @@ def test_set():
2117 # case2: flag={'reassoc', 'nsz'}
2218 fastmath ._set ("fastmath" , "_add_assoc" , flag = {"reassoc" , "nsz" })
2319 out = fastmath ._add_assoc (0 , np .inf )
24- assert out == 0.0
20+ if numba .config .DISABLE_JIT :
21+ assert np .isnan (out )
22+ else : # pragma: no cover
23+ assert out == 0.0
2524
2625 # case3: flag={'reassoc'}
2726 fastmath ._set ("fastmath" , "_add_assoc" , flag = {"reassoc" })
@@ -41,4 +40,7 @@ def test_reset():
4140 # and then reset it to the default value, i.e. `True`
4241 fastmath ._set ("fastmath" , "_add_assoc" , False )
4342 fastmath ._reset ("fastmath" , "_add_assoc" )
44- assert fastmath ._add_assoc (0.0 , np .inf ) == 0.0
43+ if numba .config .DISABLE_JIT :
44+ assert np .isnan (fastmath ._add_assoc (0.0 , np .inf ))
45+ else : # pragma: no cover
46+ assert fastmath ._add_assoc (0.0 , np .inf ) == 0.0
0 commit comments