예제 #1
0
파일: run.py 프로젝트: rowlandking/yuno
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)])
예제 #2
0
파일: run.py 프로젝트: Alex-C-Eltima/yuno
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)]))
예제 #3
0
파일: run.py 프로젝트: freeqinc/cse131-p2
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)]))
예제 #4
0
파일: show.py 프로젝트: rowlandking/yuno
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)
예제 #5
0
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))
예제 #6
0
파일: run.py 프로젝트: ledinhminh/yuno
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)])
예제 #7
0
파일: show.py 프로젝트: rowlandking/yuno
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"))
예제 #8
0
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')))
예제 #9
0
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'))