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.3.0.tar.gz (751.8 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.3.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pytest_impacted-0.3.0.tar.gz
  • Upload date:
  • Size: 751.8 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.3.0.tar.gz
Algorithm Hash digest
SHA256 312ffd6a0bf5e94bb897161a76ee25aaefdde8bba00749958d30de9dbc13f019
MD5 c95a53489c51e16d06d2e0504bf526da
BLAKE2b-256 3fc2be7c72e4d05c85b54fef70c6269d3ad4ec49960257be6e93851f10ce8b07

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_impacted-0.3.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.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_impacted-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 26c135a6548b76864aa0c36878d4f441cf5d2dfb88637107a1f645b2d4a979e3
MD5 1307fc561a8dbc0bc787763021786f11
BLAKE2b-256 0789eef3e62139bc9e05a407279ad9a9253cd180180cc6e084d48f9c701ac448

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_impacted-0.3.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