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

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

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pytest_impacted-0.2.0.tar.gz
  • Upload date:
  • Size: 748.7 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.2.0.tar.gz
Algorithm Hash digest
SHA256 a425bd346b3903fb4d0228a147ea1b56a693d8a939aa5e796e5bf940d1df1801
MD5 398e1dbb8f9a149c85d564f45249ef79
BLAKE2b-256 f6728380a6794cac782e2874db2b763b83fd53ae68429e4fddead955c32c320a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pytest_impacted-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 349943eb352a58018ad0d67e8ed04f98ddd4bde1ab6db54a01f0dc83e13e8f76
MD5 24367eabe2b84deae39ce293476a60c3
BLAKE2b-256 172e4de1c9b7ecf79882176435ebd06b25eefdf45c5d30f78a27083af63c9a66

See more details on using hashes here.

Provenance

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