Skip to main content

coverwise

PyPI npm License

Combinatorial test coverage for Python. The coverwise package ships the native C++ CLI plus a Python API that generates, analyzes, and incrementally extends t-wise test suites — including a pytest decorator that replaces a hand-written cross-product with a covering suite.

Installation

pip install coverwise

Supported wheels: Linux x86_64, Linux aarch64, and macOS 14+ Apple Silicon. The package ships a prebuilt executable rather than portable Python code, so other platforms have to build the CLI from source. There are no Python runtime dependencies, and the coverwise command is installed directly.

Quick Start

import coverwise

result = coverwise.generate(
    parameters={
        "os": ["Linux", "macOS", "Windows"],
        "browser": ["Chrome", "Firefox", "Safari"],
    },
    constraints=["IF os = Windows THEN browser != Safari"],
    strength=2,
)

result["coverage"]  # 1
result["tests"]     # [{"os": "Linux", "browser": "Firefox"}, ...]

Every function takes and returns plain dictionaries — the same JSON the CLI reads and writes:

Function Purpose
generate(model, **fields) Generate a covering suite
analyze_coverage(parameters, tests, strength, constraints) Measure an existing suite
extend_tests(existing, model, **fields) Extend a suite, keeping existing tests
estimate_model(model, **fields) Model size and validity, without generating

Invalid models and unparsable constraints raise coverwise.CoverwiseError, carrying code, exit_code, and the CLI's stderr.

pytest

coverwise.parametrize runs a test once per generated case, passing each parameter as a same-named argument:

import coverwise

@coverwise.parametrize(
    {
        "os": ["Windows", "macOS", "Linux"],
        "browser": ["Chrome", "Firefox", "Safari"],
        "locale": ["en", "ja"],
    },
    constraints=["IF os = Windows THEN browser != Safari"],
)
def test_login(os, browser, locale):
    assert login(os, browser, locale).ok

The full cross-product is 18 cases; the pairwise suite covers every pair in far fewer. pytest is not a dependency of this package — the decorator only needs it where tests run, and pip install coverwise[pytest] installs both together.

Command Line

coverwise generate input.json > tests.json
coverwise analyze --params input.json --tests tests.json
coverwise extend --existing tests.json input.json > updated.json
coverwise stats input.json

Any input path may be - to read that JSON from standard input. python -m coverwise is equivalent to the installed command, and coverwise --help lists every command with its exit-code contract.

See the Python API reference, the CLI reference, and the full project documentation.

License

Apache-2.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

coverwise-1.4.0-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (403.5 kB view details)

Uploaded Python 3manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

coverwise-1.4.0-py3-none-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (361.1 kB view details)

Uploaded Python 3manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

coverwise-1.4.0-py3-none-macosx_14_0_arm64.whl (178.8 kB view details)

Uploaded Python 3macOS 14.0+ ARM64

File details

Details for the file coverwise-1.4.0-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for coverwise-1.4.0-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 deb86d6f554847f159691fb9ae0f4d968cf7bb984cf0f8662de27b0840a4c587
MD5 8ee145562489eb159e1e11c7ded9fd39
BLAKE2b-256 884336b31240227971740063a600ee7a236f3f971abf68094e930adc990cc02f

See more details on using hashes here.

Provenance

The following attestation bundles were made for coverwise-1.4.0-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yml on libraz/coverwise

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file coverwise-1.4.0-py3-none-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for coverwise-1.4.0-py3-none-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 8a8e7a43d817b0b485518f623e8d7c8923cbae5df2e969d9a8e4bb35a1ae570b
MD5 08fe8954e4305afac1318e77edc4b4cf
BLAKE2b-256 c0ffdfc312e78380e0771ff6f1bae5664ade5b854c65374385568abfb64713d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for coverwise-1.4.0-py3-none-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl:

Publisher: publish.yml on libraz/coverwise

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file coverwise-1.4.0-py3-none-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for coverwise-1.4.0-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 5d172f8b2e2b2cb66c969fe76d1d5b17b5a5ac98fe58dbc03f18374b0c8ff28f
MD5 1b6e4cc8016ffe9aa30fab868b27e8a3
BLAKE2b-256 286fcd18984434b4c21fe01b948fa141c0f150e3342fd94039484da8377e5568

See more details on using hashes here.

Provenance

The following attestation bundles were made for coverwise-1.4.0-py3-none-macosx_14_0_arm64.whl:

Publisher: publish.yml on libraz/coverwise

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page