Skip to content

Commit 2f09c0f

Browse files
committed
Skip the SR test if the PySR is not installed
1 parent 876731e commit 2f09c0f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

test/pytest/test_sr.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import warnings
21
from pathlib import Path
32

43
import numpy as np
@@ -47,8 +46,7 @@ def test_pysr_luts(data):
4746
try:
4847
from pysr import PySRRegressor
4948
except ImportError:
50-
warnings.warn(UserWarning('Failed to import PySR, test will be skipped.'), stacklevel=1)
51-
return True
49+
pytest.skip('Failed to import PySR, test will be skipped.')
5250

5351
function_definitions = ['cos_lut(x) = math_lut(cos, x, N=1024, range_start=-4, range_end=4)']
5452
hls4ml.utils.symbolic_utils.init_pysr_lut_functions(init_defaults=True, function_definitions=function_definitions)

0 commit comments

Comments
 (0)