(example, reporter=None)
Run a specific example.

    Returns a boolean value indicating whether the example was successful.
Run a specific example.
Run a specific example .
def run_example(example, reporter=None):
    """Run a specific example.

    Returns a boolean value indicating whether the example was successful.
    """
    if reporter:
        reporter.write(example)
    else:
        print("=" * 79)
        print("Running: ", example)

    try:
        mod = load_example_module(example)
        if reporter:
            suppress_output(mod.main)
            reporter.write("[PASS]", "Green", align="right")
        else:
            mod.main()
        return True
    except:
        if reporter:
            reporter.write("[FAIL]", "Red", align="right")
        traceback.print_exc()
        return False
def run_example ( example , reporter = None ) : if reporter : reporter . write ( example ) else : print ( "=" * 79 ) print ( "Running: " , example ) try : mod = load_example_module ( example ) if reporter : suppress_output ( mod . main ) reporter . write ( "[PASS]" , "Green" , align = "right" ) else : mod . main ( ) return True except : if reporter : reporter . write ( "[FAIL]" , "Red" , align = "right" ) traceback . print_exc ( ) return False