Example #1
0
    def run(self):
        tests_successful = True

        try:
            if not sympy.test():
                # some regular test fails, so set the tests_successful
                # flag to false and continue running the doctests
                tests_successful = False

            if not sympy.doctest():
                tests_successful = False

            if not (sys.platform == "win32" or sys.version_info[0] == 3):
                # run Sage tests; Sage currently doesn't support Windows or Python 3
                dev_null = open(os.devnull, 'w')
                if subprocess.call("sage -v", shell = True, stdout = dev_null, stderr = dev_null) == 0:
                    if subprocess.call("sage -python bin/test sympy/external/tests/test_sage.py", shell = True) != 0:
                        tests_successful = False

            if tests_successful:
                return
            else:
                # Return nonzero exit code
                sys.exit(1)
        except KeyboardInterrupt:
            print
            print("DO *NOT* COMMIT!")
            sys.exit(1)
Example #2
0
File: setup.py Project: itsrg/sympy
 def run(self):
     if sympy.test():
         # all regular tests run successfuly, so let's also run doctests
         # (if some regular test fails, the doctests are not run)
         if sympy.doctest():
             # All ok
             return
     # Return nonzero exit code
     sys.exit(1)
Example #3
0
    def run(self):
        tests_successful = True
        try:
            if not sympy.test():
                # some regular test fails, so set the tests_successful
                # flag to false and continue running the doctests
                tests_successful = False

            if not sympy.doctest():
                tests_successful = False

            if tests_successful:
                return
            else:
                # Return nonzero exit code
                sys.exit(1)
        except KeyboardInterrupt:
            print
            print("DO *NOT* COMMIT!")
            sys.exit(1)
Example #4
0
    def run(self):
        tests_successful = True
        try:
            if not sympy.test():
                # some regular test fails, so set the tests_successful
                # flag to false and continue running the doctests
                tests_successful = False

            if not sympy.doctest():
                tests_successful = False

            if tests_successful:
                return
            else:
                # Return nonzero exit code
                sys.exit(1)
        except KeyboardInterrupt:
            print
            print("DO *NOT* COMMIT!")
            sys.exit(1)
Example #5
0
    def run(self):
        tests_successful = True

        try:
            if not sympy.test():
                # some regular test fails, so set the tests_successful
                # flag to false and continue running the doctests
                tests_successful = False

            if not sympy.doctest():
                tests_successful = False

            print
            sys.path.append("examples")
            from all import run_examples  # examples/all.py
            if not run_examples(quiet=True):
                tests_successful = False

            if not (sys.platform == "win32" or sys.version_info[0] == 3):
                # run Sage tests; Sage currently doesn't support Windows or Python 3
                dev_null = open(os.devnull, 'w')
                if subprocess.call("sage -v",
                                   shell=True,
                                   stdout=dev_null,
                                   stderr=dev_null) == 0:
                    if subprocess.call(
                            "sage -python bin/test sympy/external/tests/test_sage.py",
                            shell=True) != 0:
                        tests_successful = False

            if tests_successful:
                return
            else:
                # Return nonzero exit code
                sys.exit(1)
        except KeyboardInterrupt:
            print
            print("DO *NOT* COMMIT!")
            sys.exit(1)
Example #6
0
 def run(self):
     if sympy.test():
         # all regular tests run successfuly, so let's also run doctests
         # (if some regular test fails, the doctests are not run)
         sympy.doctest()
Example #7
0
    # matchpy
    '*rubi*',

    # codegen
    'sympy/codegen/',

    # pycosat
    'sympy/logic',
    'sympy/assumptions',

    #stats
    'sympy/stats',
]

if not (sympy.test(*test_list, blacklist=blacklist)
        and sympy.doctest(*doctest_list)):
    raise TestsFailedError('Tests failed')

print('Testing MATPLOTLIB')
# Set matplotlib so that it works correctly in headless Travis. We have to do
# this here because it doesn't work after the sympy plotting module is
# imported.
import matplotlib
matplotlib.use("Agg")
import sympy
# Unfortunately, we have to use subprocess=False so that the above will be
# applied, so no hash randomization here.
if not (sympy.test('sympy/plotting',
                   'sympy/physics/quantum/tests/test_circuitplot.py',
                   subprocess=False)
        and sympy.doctest('sympy/plotting', subprocess=False)):
Example #8
0
 def run(self):
     sympy.doctest()
Example #9
0
    # matchpy
    '*rubi*',

    # codegen
    'sympy/codegen/',

    # pycosat
    'sympy/logic',
    'sympy/assumptions',

    #stats
    'sympy/stats',

]

if not (sympy.test(*test_list, blacklist=blacklist) and sympy.doctest(*doctest_list)):
    raise TestsFailedError('Tests failed')


print('Testing MATPLOTLIB')
# Set matplotlib so that it works correctly in headless Travis. We have to do
# this here because it doesn't work after the sympy plotting module is
# imported.
import matplotlib
matplotlib.use("Agg")
import sympy
# Unfortunately, we have to use subprocess=False so that the above will be
# applied, so no hash randomization here.
if not (sympy.test('sympy/plotting', 'sympy/physics/quantum/tests/test_circuitplot.py',
    subprocess=False) and sympy.doctest('sympy/plotting', subprocess=False)):
    raise TestsFailedError('Tests failed')
Example #10
0
#!/usr/bin/env python
"""
Run tests involving tensorflow

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

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


class TestsFailedError(Exception):
    pass


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',
]

print('Testing optional dependencies')

import sympy
if not (sympy.test(*test_list, verbose=True) and sympy.doctest(*doctest_list)):
    raise TestsFailedError('Tests failed')