Beispiel #1
0
def run_unit_tests():
    sys.path.insert(0, SRC)
    try:
        result = py_main(['--rootdir=%s' % CURDIR])
    finally:
        sys.path.pop(0)
    return result
Beispiel #2
0
def run_unit_tests(reporter, reporter_args, suite, verbose):
    sys.path.insert(0, SRC)
    suite = CURDIR if not suite else CURDIR / "test" / suite
    py_args = [
        "--showlocals",
        "--tb=long",
        f"--rootdir={CURDIR}",
        "-p",
        "no:cacheprovider",
        str(suite),
    ]
    if verbose:
        py_args.insert(0, "-v")
    if reporter:
        py_args.insert(0, f"--approvaltests-add-reporter={reporter}")
    if reporter_args:
        py_args.insert(1, f"--approvaltests-add-reporter-args={reporter_args}")
    try:
        result = py_main(py_args)
    except Exception as error:
        print(f"Suppressed error: {error}")
        result = 254
    finally:
        sys.path.pop(0)
    return result
Beispiel #3
0
def run_unit_tests():
    sys.path.insert(0, SRC)
    try:
        result = py_main(
            ['--rootdir=%s' % CURDIR, '-p', 'no:cacheprovider', CURDIR])
    finally:
        sys.path.pop(0)
    return result
Beispiel #4
0
def run_unit_tests(reporter, reporter_args):
    sys.path.insert(0, SRC)
    py_args = ['--rootdir=%s' % CURDIR, '-p', 'no:cacheprovider', CURDIR]
    if reporter:
        py_args.insert(0, f'--approvaltests-add-reporter={reporter}')
    if reporter_args:
        py_args.insert(1, f'--approvaltests-add-reporter-args={reporter_args}')
    try:
        result = py_main(py_args)
    except Exception:
        result = 254
    finally:
        sys.path.pop(0)
    return result
Beispiel #5
0
def run_unit_tests(reporter, reporter_args):
    sys.path.insert(0, SRC)
    py_args = [f"--rootdir={CURDIR}", "-p", "no:cacheprovider", CURDIR]
    if reporter:
        py_args.insert(0, f"--approvaltests-add-reporter={reporter}")
    if reporter_args:
        py_args.insert(1, f"--approvaltests-add-reporter-args={reporter_args}")
    try:
        result = py_main(py_args)
    except Exception:
        result = 254
    finally:
        sys.path.pop(0)
    return result