File: test_tensorflow.py

package info (click to toggle)
sympy 1.14.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 36,784 kB
  • sloc: python: 460,598; xml: 359; makefile: 162; sh: 59; lisp: 4
file content (35 lines) | stat: -rwxr-xr-x 938 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python
"""
Run tests involving tensorflow

These are separate from the other optional dependency tests because tensorflow
pins the numpy version.
"""

TEST_LIST = DOCTEST_LIST = [
    'sympy/printing/tensorflow.py',
    'sympy/printing/tests/test_tensorflow.py',
    'sympy/stats/sampling',
    'sympy/utilities/lambdify.py',
    'sympy/utilities/tests/test_lambdify.py',
]


if __name__ == "__main__":

    import sys

    # Add the local SymPy to sys.path (needed for CI)
    from get_sympy import path_hack
    path_hack()
    import sympy

    # Note: The doctests are not tested here but there are many failures when
    # running them with symengine.
    args = TEST_LIST
    test_exit_code = sympy.test(*args, verbose=True)
    if test_exit_code != 0:
        sys.exit(test_exit_code)
    doctest_exit_code = sympy.doctest(*DOCTEST_LIST)
    exit_code = 0 if doctest_exit_code is True else 1
    sys.exit(exit_code)