def run():
dirname = os.path.abspath(os.path.join(os.path.dirname(__file__), '.'))
# We write to stderr since nose does all of its output on stderr as well
sys.stderr.write('Running tests in "%s" ' % dirname)
success = []
argv = ['nosetests', dirname]
success.append(nose.run(argv=argv))
all_success = all(success)
if not all_success:
sys.stderr.write(('ERROR: %d/%d test suite(s) did not complete '
'successfully (see above).\n') % (len(success) - sum(success),
len(success)))
else:
sys.stderr.write(('OK: %d/%d test suite(s) did complete '
'successfully.\n') % (len(success), len(success)))
评论列表
文章目录