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()
def check_deps(): """Check if npm and friends are installed""" return npm.check_dependencies()
def setUpModule(): if not npm.check_dependencies(): raise AssertionError("npm dependency check failed. Is npm installed?")
def setUpModule(): if not npm.check_dependencies(): raise AssertionError('npm dependency check failed. Is npm installed?')