Skip to content

Commit e90f355

Browse files
committed
Test specific parts of SymPy
1 parent a267427 commit e90f355

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ env:
2626
## executed.
2727
matrix:
2828
# Debug builds:
29-
- BUILD_TYPE="Debug" WITH_BFD="yes" PYTHON_VERSION="2.7" TRIGGER_FEEDSTOCK="yes"
30-
- BUILD_TYPE="Debug" WITH_BFD="yes" PYTHON_VERSION="3.6"
29+
- BUILD_TYPE="Debug" WITH_BFD="yes" PYTHON_VERSION="2.7" TRIGGER_FEEDSTOCK="yes" TEST_SYMPY="yes"
30+
- BUILD_TYPE="Debug" WITH_BFD="yes" PYTHON_VERSION="3.6" TEST_SYMPY="yes"
3131

3232
# Release builds:
3333
- PYTHON_VERSION="2.7" BUILD_SHARED_LIBS="yes"

bin/install_travis.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ if [[ "${WITH_SYMPY}" != "no" ]]; then
99
export conda_pkgs="${conda_pkgs} sympy";
1010
fi
1111

12+
if [[ "${TEST_SYMPY}" == "yes" ]]; then
13+
export TEST_SYMPY = 1;
14+
fi
15+
1216
if [[ "${WITH_NUMPY}" != "no" ]]; then
1317
export conda_pkgs="${conda_pkgs} numpy";
1418
fi

bin/test_python.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
import os
2+
TEST_SYMPY = os.getenv('TEST_SYMPY', '0')
3+
14
import symengine
25
if not symengine.test():
36
raise Exception('Tests failed')
7+
8+
try:
9+
import sympy
10+
from sympy.core.cache import clear_cache
11+
import atexit
12+
13+
atexit.register(clear_cache)
14+
have_sympy = True
15+
except ImportError:
16+
have_sympy = False
17+
18+
if TEST_SYMPY and have_sympy:
19+
print('Testing SYMPY')
20+
if not sympy.test('sympy/physics/mechanics'):
21+
raise Exception('Tests failed')
22+
if not sympy.test('sympy/liealgebras'):
23+
raise Exception('Tests failed')

0 commit comments

Comments
 (0)