Skip to content

Commit 967d49e

Browse files
committed
Skip test if sympy not found
1 parent e9e06d8 commit 967d49e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

symengine/tests/test_matrices.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@
1010
HAVE_NUMPY = True
1111
except ImportError:
1212
HAVE_NUMPY = False
13+
14+
try:
15+
import sympy
16+
from sympy.core.cache import clear_cache
17+
import atexit
18+
atexit.register(clear_cache)
19+
have_sympy = True
20+
except ImportError:
21+
have_sympy = False
1322

1423

1524
def test_init():
@@ -742,7 +751,7 @@ def test_repr_latex():
742751
assert isinstance(latex_string, str)
743752
init_printing(False)
744753

745-
754+
@unittest.skipIf(not have_sympy, "SymPy not installed")
746755
def test_simplify():
747756
A = ImmutableMatrix([1])
748757
assert type(A.simplify()) == type(A)

0 commit comments

Comments
 (0)