def _display_results(harness): num_passed = len(harness.passed) num_failed = len(harness.failed) num_skipped = len(harness.skipped) num_warned = len(harness.warned) num_regressions = len(harness.regressions) num_fixes = len(harness.fixes) total = num_passed + num_failed + num_skipped print "=" * 80 print "Ran %d tests\n" % total print " %d passed" % num_passed print " %d failed" % num_failed if num_failed > 0: print " View? yuno.py show failed" print " Re-run? yuno.py run failed" # note about diff files goes here if num_skipped > 0: print " %d skipped" % num_skipped print " View? yuno.py show skipped" if num_warned > 0: print " %d warned" % num_warned print " View? yuno.py show warned" if num_regressions > 0: print "\n- %d %s\n " % (num_regressions, util.nice_plural(num_regressions, "regression", "regressions")), print "\n ".join([str(test) for test in sorted(harness.regressions)]) if num_fixes > 0: print "\n+ %d fixed :)\n " % num_fixes, print "\n ".join([str(test) for test in sorted(harness.fixes)])
def display_results(harness): num_passed = len(harness.passed) num_failed = len(harness.failed) num_skipped = len(harness.skipped) num_warned = len(harness.warned) num_regressions = len(harness.regressions) num_fixes = len(harness.fixes) total = num_passed + num_failed + num_skipped print("=" * 80) print("Ran %d %s\n" % (total, util.nice_plural(total, 'test', 'tests'))) print(" %d passed" % num_passed) print(" %d failed" % num_failed) if num_failed > 0: print(" View? yuno show failed") print(" Re-run? yuno run failed") # note about diff files goes here if num_skipped > 0: print(" %d skipped" % num_skipped) print(" View? yuno show skipped") if num_warned > 0: print(" %d warned" % num_warned) print(" View? yuno show warned") if num_regressions > 0: print("\n- %d %s\n " % ( num_regressions, util.nice_plural(num_regressions, 'regression', 'regressions')), end='') print("\n ".join([str(r) for r in sorted(harness.regressions)])) if num_fixes > 0: print("\n+ %d fixed :)\n " % num_fixes, end='') print("\n ".join([str(f) for f in sorted(harness.fixes)]))
def _show_by_type(result_type, line_indent=" "): last_run = history.RunRecord.from_last_run() tests = last_run.__dict__[result_type] num_of_type = len(tests) when = last_run.when.strftime(history.RunRecord.time_format) message = util.nice_plural(num_of_type, "test", "tests") if num_of_type == 0: print "No {} {} last run ({})".format(message, result_type, when) return print "%s last run:\n" % result_type.capitalize() for test in sorted(tests): print line_indent + test.strip() print "\n%d %s %s, %s" % (num_of_type, message, result_type, when)
def _show_by_type(result_type, line_indent=' '): last_run = history.RunRecord.from_last_run() tests = last_run.__dict__[result_type] num_of_type = len(tests) when = last_run.when.strftime(history.RunRecord.time_format) message = util.nice_plural(num_of_type, 'test', 'tests') if num_of_type == 0: print("No {} {} last run ({})".format(message, result_type, when)) return print("%s last run:\n" % result_type.capitalize()) for test in sorted(tests): print(line_indent + test.strip()) print("\n%d %s %s, %s" % (num_of_type, message, result_type, when))
def _display_results(harness): num_passed = len(harness.passed) num_failed = len(harness.failed) num_skipped = len(harness.skipped) num_warned = len(harness.warned) num_regressions = len(harness.regressions) num_fixes = len(harness.fixes) total = num_passed + num_failed + num_skipped print "=" * 80 print "Ran %d tests\n" % total print " %d passed" % num_passed print " %d failed" % num_failed if num_failed > 0: print " View? yuno.py show failed" print " Re-run? yuno.py run failed" # note about diff files goes here if num_skipped > 0: print " %d skipped" % num_skipped print " View? yuno.py show skipped" if num_warned > 0: print " %d warned" % num_warned print " View? yuno.py show warned" if num_regressions > 0: print "\n- %d %s\n " % ( num_regressions, util.nice_plural(num_regressions, 'regression', 'regressions') ), print "\n ".join([str(test) for test in sorted(harness.regressions)]) if num_fixes > 0: print "\n+ %d fixed :)\n " % num_fixes, print "\n ".join([str(test) for test in sorted(harness.fixes)])
def _show_passing(): print "All passing:\n" count = _show_file(_in_data_folder("passing.txt")) print "\n%d %s" % (count, util.nice_plural(count, "test", "tests"))
def _show_passing(): print("All passing:\n") count = _show_file(_in_data_folder('passing.txt')) print("\n%d %s" % (count, util.nice_plural(count, 'test', 'tests')))
def _show_failing(): print "All failing:\n" count = _show_file(_in_data_folder('failing.txt')) print "\n%d %s" % (count, util.nice_plural(count, 'test', 'tests'))