Skip to main content

A pytest plugin that selectively runs tests impacted by codechanges via git introspection, ASL parsing, and dependency graph analysis.

Project description

pytest-impacted

CI GitHub License PyPI - Version PyPI - Python Version


A pytest plugin that selectively runs tests impacted by codechanges via git introspection, ASL parsing, and dependency graph analysis.

  • Configurable to meet your demands for both local and CI-driven invocations. :shipit:
  • Built using a modern, best-of-breed Python stack, using astroid for Python code AST, NetworkX for dependency graph analysis, and GitPython for interacting with git repositories. :rocket:

Installation

You can install "pytest-impacted" via pipfrom PyPI:

$ pip install pytest-impacted

Usage

Use as a pytest plugin. Examples for invocation:

$ pytest --impacted --impacted-git-mode=unstaged --impacted-module=<my_root_module_name>

This will run all unit-tests impacted by changes to files which have unstaged modifications in the current active git repository.

$ pytest --impacted --impacted-git-mode=branch --impacted-base-branch=main --impacted-module=<my_root_module_name>

this will run all unit-tests impacted by changes to files which have been modified via any existing commits to the current active branch, as compared to the base branch passed in the --impacted-base-branch parameter.

Testing

Invoke unit-tests with:

uv run python -m pytest

Linting, formatting, static type checks etc. are all managed via pre-commit hooks. These will run automatically on every commit. You can invoke these manually on all files with:

pre-commit run --all-files

Project details


Download files

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

Source Distribution

pytest_impacted-0.4.0.tar.gz (753.6 kB view details)

Uploaded Source

Built Distribution

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

pytest_impacted-0.4.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file pytest_impacted-0.4.0.tar.gz.

File metadata

  • Download URL: pytest_impacted-0.4.0.tar.gz
  • Upload date:
  • Size: 753.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pytest_impacted-0.4.0.tar.gz
Algorithm Hash digest
SHA256 0a04440c75b22659585e051f3a63dd7e7797c0ce4da5a6fd8d4d73005506eac5
MD5 9dc59bea1e3ea6651ce682eb8552310e
BLAKE2b-256 d0ed26e9bb0224b0d72753313dddc6bcca36a7e4d37c5e99ef48ffca83f722e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_impacted-0.4.0.tar.gz:

Publisher: publish-to-pypi.yml on promptromp/pytest-impacted

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

File details

Details for the file pytest_impacted-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_impacted-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ecee69ddb9d22692a6e77d418b1f78afd5e84ca8ef3550112e7243629f3f7d7a
MD5 578fdc67521ef0bc561a6d0bb6e7c9b4
BLAKE2b-256 e508c8964d8ac5fc3b37c6e11d44d9294158005246a74435aef1264c4b6472ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_impacted-0.4.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on promptromp/pytest-impacted

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