(successes, failures, reporter=None)
Shows a summary detailing which examples were successful and which failed.
Shows a summary detailing which examples were successful and which failed.
Shows a summary detailing which examples were successful and which failed .
def show_summary(successes, failures, reporter=None):
    """Shows a summary detailing which examples were successful and which failed."""
    if reporter:
        reporter.write("-" * reporter.terminal_width)
        if failures:
            reporter.write("FAILED:\n", "Red")
            for example in failures:
                reporter.write("  %s\n" % example)
        else:
            reporter.write("ALL EXAMPLES PASSED\n", "Green")
    else:
        if successes:
            print("SUCCESSFUL: ", file=sys.stderr)
            for example in successes:
                print("  -", example, file=sys.stderr)
        else:
            print("NO SUCCESSFUL EXAMPLES", file=sys.stderr)

        if failures:
            print("FAILED: ", file=sys.stderr)
            for example in failures:
                print("  -", example, file=sys.stderr)
        else:
            print("NO FAILED EXAMPLES", file=sys.stderr)
def show_summary ( successes , failures , reporter = None ) : if reporter : reporter . write ( "-" * reporter . terminal_width ) if failures : reporter . write ( "FAILED:\n" , "Red" ) for example in failures : reporter . write ( "  %s\n" % example ) else : reporter . write ( "ALL EXAMPLES PASSED\n" , "Green" ) else : if successes : print ( "SUCCESSFUL: " , file = sys . stderr ) for example in successes : print ( "  -" , example , file = sys . stderr ) else : print ( "NO SUCCESSFUL EXAMPLES" , file = sys . stderr ) if failures : print ( "FAILED: " , file = sys . stderr ) for example in failures : print ( "  -" , example , file = sys . stderr ) else : print ( "NO FAILED EXAMPLES" , file = sys . stderr )