Esempio n. 1
0

def _discover_tests(root, pattern):
    global _discovery_enabled
    atexit.unregister(_run_at_exit)
    _discovery_enabled = False
    _discover.discover_tests(root, pattern)
    _discovery_enabled = True


def _run_at_exit():
    args, name = parsers.get_args()
    if args:
        run_all(args)


def run_all(args):
    suite = _discover.get_suite(config.SUITE)

    report = suite()
    print

    if config.REPORT_ACTION == config.ActionEnum.PRINT:
        report.print_()
    else:
        report.write(config.REPORT_OUTFILE)


parsers.install_main_parser()
atexit.register(_run_at_exit)
Esempio n. 2
0
def discover_tests_cmd(root, pattern=".*", **args):
    if _discovery_enabled:
        _discover_tests(root, pattern)
        run_all(args)

def _discover_tests(root, pattern):
    global _discovery_enabled
    atexit.unregister(_run_at_exit)
        _discovery_enabled = False
        _discover.discover_tests(root,pattern)
        _discovery_enabled = True

def _run_at_exit():
    args,name = parsers.get_args()
    if args:
        run_all(args)

def run_all(args):
    suite = _discover.get_suite(config.SUITE)
    
    report = suite()
    print
    
    if config.REPORT_ACTION == config.ActionEnum.WRITE:
        report.write()
    else:
        report.print_()
    
parsers.install_main_parser()
atexit.register(_run_at_exit)
Esempio n. 3
0
def discover_tests_api(root, pattern=".*", suite_name=None):
    if _discovery_enabled:
        atexit.unregister(_run_at_exit)
        _discover_tests(root,pattern)
        return tags.get_suite(suite_name)

def discover_tests_cmd(root, pattern=".*", **args):
    if _discovery_enabled:
        atexit.unregister(_run_at_exit)
        _discover_tests(root,pattern)
        run_all(args)

def _run_at_exit():
    args,name = get_args()
    if args:
        run_all(args)

def run_all(args):
    kwargs = {"html":args["html"]}

    suite = tags.get_suite(args["suite"])
    
    if suite:
        report = suite()

        printer = printers.html if args["html"] else printers.get_default()
        printers.print_report(report,printer,**kwargs)

install_main_parser()
atexit.register(_run_at_exit)