Esempio n. 1
0
def run(disableLogger=True, exclude_pattern='(?!)'):
    """Runs tests for the taurus package"""
    # disable logging messages
    if disableLogger:
        taurus.disableLogOutput()
    # discover tests within the taurus/lib directory
    suite = get_taurus_suite(exclude_pattern=exclude_pattern)
    # use the basic text test runner that outputs to sys.stderr
    runner = unittest.TextTestRunner(descriptions=True, verbosity=2)
    # run the test suite
    return runner.run(suite)
Esempio n. 2
0
def run():
    '''Runs all tests for the sardana package

    :returns: the test runner result
    :rtype: unittest.result.TestResult
    '''
    # discover all tests within the sardana/src directory
    loader = unittest.defaultTestLoader
    start_dir = os.path.dirname(sardana.__file__)
    suite = loader.discover(start_dir,
                            top_level_dir=os.path.dirname(start_dir))
    # use the basic text test runner that outputs to sys.stderr
    runner = unittest.TextTestRunner(descriptions=True, verbosity=2)
    # run the test suite
    result = runner.run(suite)
    return result