def run_tests(): if config.arguments['--tox']: sh.tox() else: sh.nosetests() return True
def main(all_files=False): git.stash(u=True, keep_index=True) try: results = nosetests('cardscript/', with_doctest=True) result = True except sh.ErrorReturnCode as exc: # If anything goes wrong, let us know, but abandon the commit. git.reset(hard=True) # Code is wrong, reset it. print("ERROR: Tests FAILED; Commit ABORTED.") print(exc.stderr) result = False finally: git.stash('pop', q=True) # Restore anything in our working directory. return result
def run_nosetest(test=None): if test is None: filename = "/tmp/nosetests_all.json" testname = "" else: filename = "/tmp/nosetests_{0}.json".format(test) testname = "../tests/test_{0}.py".format(test) print "PWD", pwd() try: result = nosetests("--with-json", "-w", "../tests", "--json-file='{0}' {1}".format(filename, testname)) except: pass print "RRRR", result return redirect("/test/nose")