Esempio n. 1
0
def main(test_spec, should_write_xml, max_size, appengine_sdk_dir=None):
    fix_sys_path(appengine_sdk_dir)

    # This import needs to happen after fix_sys_path is run.
    from testutil import testsize
    testsize.set_max_size(max_size)

    if not npm.check_dependencies():
        return

    loader = unittest.loader.TestLoader()
    if not os.path.exists(test_spec):
        suite = loader.loadTestsFromName(test_spec)
    elif test_spec.endswith('.py'):
        suite = loader.loadTestsFromName(file_path_to_module(test_spec))
    else:
        suite = loader.discover(test_spec, pattern=TEST_FILE_RE)

    if should_write_xml:
        runner = xmlrunner.XMLTestRunner(verbose=True, output='test-reports')
    else:
        runner = unittest.TextTestRunner(verbosity=2)

    result = runner.run(suite)

    return not result.wasSuccessful()
Esempio n. 2
0
def check_deps():
    """Check if npm and friends are installed"""
    return npm.check_dependencies()
Esempio n. 3
0
def check_deps():
    """Check if npm and friends are installed"""
    return npm.check_dependencies()
Esempio n. 4
0
def setUpModule():
    if not npm.check_dependencies():
        raise AssertionError("npm dependency check failed. Is npm installed?")
Esempio n. 5
0
def setUpModule():
    if not npm.check_dependencies():
        raise AssertionError('npm dependency check failed. Is npm installed?')