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.1.0.tar.gz (748.4 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.1.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pytest_impacted-0.1.0.tar.gz
  • Upload date:
  • Size: 748.4 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.1.0.tar.gz
Algorithm Hash digest
SHA256 e3d022ef78349d9257c358102b3d5326bcb66307409c4ea5d4edfee3c966a5de
MD5 6f906b66b6b1cb322309123da82951e9
BLAKE2b-256 8757d7db181fcdfd9e031b20382ff3fd5c92efd8f49c655047f7d6f1d1a9d9b5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pytest_impacted-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f34787227bceb78df846ca538e4c49b57578b05955f2dd28890f23f86ecfaf34
MD5 1feed8be52701602dbb765b0b7913a57
BLAKE2b-256 21fd09735e49bf816797cc2fda0247e909ce52e0e811c92707bd4103fb4ef655

See more details on using hashes here.

Provenance

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