How to use the mutmut.compute_exit_code function in mutmut

To help you get started, we’ve selected a few mutmut examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github boxed / mutmut / tests / test_main.py View on Github external
assert compute_exit_code(MockProgress(1, 0, 0, 0)) == 0
    assert compute_exit_code(MockProgress(1, 0, 0, 1)) == 8
    assert compute_exit_code(MockProgress(1, 0, 1, 0)) == 4
    assert compute_exit_code(MockProgress(1, 0, 1, 1)) == 12
    assert compute_exit_code(MockProgress(1, 1, 0, 0)) == 2
    assert compute_exit_code(MockProgress(1, 1, 0, 1)) == 10
    assert compute_exit_code(MockProgress(1, 1, 1, 0)) == 6
    assert compute_exit_code(MockProgress(1, 1, 1, 1)) == 14

    assert compute_exit_code(MockProgress(0, 0, 0, 0), Exception()) == 1
    assert compute_exit_code(MockProgress(0, 0, 0, 1), Exception()) == 9
    assert compute_exit_code(MockProgress(0, 0, 1, 0), Exception()) == 5
    assert compute_exit_code(MockProgress(0, 0, 1, 1), Exception()) == 13
    assert compute_exit_code(MockProgress(0, 1, 0, 0), Exception()) == 3
    assert compute_exit_code(MockProgress(0, 1, 0, 1), Exception()) == 11
    assert compute_exit_code(MockProgress(0, 1, 1, 0), Exception()) == 7
    assert compute_exit_code(MockProgress(0, 1, 1, 1), Exception()) == 15

    assert compute_exit_code(MockProgress(1, 0, 0, 0), Exception()) == 1
    assert compute_exit_code(MockProgress(1, 0, 0, 1), Exception()) == 9
    assert compute_exit_code(MockProgress(1, 0, 1, 0), Exception()) == 5
    assert compute_exit_code(MockProgress(1, 0, 1, 1), Exception()) == 13
    assert compute_exit_code(MockProgress(1, 1, 0, 0), Exception()) == 3
    assert compute_exit_code(MockProgress(1, 1, 0, 1), Exception()) == 11
    assert compute_exit_code(MockProgress(1, 1, 1, 0), Exception()) == 7
    assert compute_exit_code(MockProgress(1, 1, 1, 1), Exception()) == 15
github boxed / mutmut / tests / test_main.py View on Github external
self.surviving_mutants_timeout = surviving_mutants_timeout
            self.suspicious_mutants = suspicious_mutants

    assert compute_exit_code(MockProgress(0, 0, 0, 0)) == 0
    assert compute_exit_code(MockProgress(0, 0, 0, 1)) == 8
    assert compute_exit_code(MockProgress(0, 0, 1, 0)) == 4
    assert compute_exit_code(MockProgress(0, 0, 1, 1)) == 12
    assert compute_exit_code(MockProgress(0, 1, 0, 0)) == 2
    assert compute_exit_code(MockProgress(0, 1, 0, 1)) == 10
    assert compute_exit_code(MockProgress(0, 1, 1, 0)) == 6
    assert compute_exit_code(MockProgress(0, 1, 1, 1)) == 14

    assert compute_exit_code(MockProgress(1, 0, 0, 0)) == 0
    assert compute_exit_code(MockProgress(1, 0, 0, 1)) == 8
    assert compute_exit_code(MockProgress(1, 0, 1, 0)) == 4
    assert compute_exit_code(MockProgress(1, 0, 1, 1)) == 12
    assert compute_exit_code(MockProgress(1, 1, 0, 0)) == 2
    assert compute_exit_code(MockProgress(1, 1, 0, 1)) == 10
    assert compute_exit_code(MockProgress(1, 1, 1, 0)) == 6
    assert compute_exit_code(MockProgress(1, 1, 1, 1)) == 14

    assert compute_exit_code(MockProgress(0, 0, 0, 0), Exception()) == 1
    assert compute_exit_code(MockProgress(0, 0, 0, 1), Exception()) == 9
    assert compute_exit_code(MockProgress(0, 0, 1, 0), Exception()) == 5
    assert compute_exit_code(MockProgress(0, 0, 1, 1), Exception()) == 13
    assert compute_exit_code(MockProgress(0, 1, 0, 0), Exception()) == 3
    assert compute_exit_code(MockProgress(0, 1, 0, 1), Exception()) == 11
    assert compute_exit_code(MockProgress(0, 1, 1, 0), Exception()) == 7
    assert compute_exit_code(MockProgress(0, 1, 1, 1), Exception()) == 15

    assert compute_exit_code(MockProgress(1, 0, 0, 0), Exception()) == 1
    assert compute_exit_code(MockProgress(1, 0, 0, 1), Exception()) == 9
github boxed / mutmut / mutmut / __main__.py View on Github external
paths_to_mutate=paths_to_mutate,
    )

    parse_run_argument(argument, config, dict_synonyms, mutations_by_file, paths_to_exclude, paths_to_mutate, tests_dirs)

    config.total = sum(len(mutations) for mutations in mutations_by_file.values())

    print()
    print('2. Checking mutants')
    progress = Progress(total=config.total)

    try:
        run_mutation_tests(config=config, progress=progress, mutations_by_file=mutations_by_file)
    except Exception as e:
        traceback.print_exc()
        return compute_exit_code(progress, e)
    else:
        return compute_exit_code(progress)
    finally:
        print()  # make sure we end the output with a newline
        # Close all active multiprocessing queues to avoid hanging up the main process
        close_active_queues()
github boxed / mutmut / mutmut / __main__.py View on Github external
parse_run_argument(argument, config, dict_synonyms, mutations_by_file, paths_to_exclude, paths_to_mutate, tests_dirs)

    config.total = sum(len(mutations) for mutations in mutations_by_file.values())

    print()
    print('2. Checking mutants')
    progress = Progress(total=config.total)

    try:
        run_mutation_tests(config=config, progress=progress, mutations_by_file=mutations_by_file)
    except Exception as e:
        traceback.print_exc()
        return compute_exit_code(progress, e)
    else:
        return compute_exit_code(progress)
    finally:
        print()  # make sure we end the output with a newline
        # Close all active multiprocessing queues to avoid hanging up the main process
        close_active_queues()