A pytest plugin that selectively runs tests impacted by codechanges via git introspection, ASL parsing, and dependency graph analysis.
Project description
pytest-impacted
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
312ffd6a0bf5e94bb897161a76ee25aaefdde8bba00749958d30de9dbc13f019
|
|
| MD5 |
c95a53489c51e16d06d2e0504bf526da
|
|
| BLAKE2b-256 |
3fc2be7c72e4d05c85b54fef70c6269d3ad4ec49960257be6e93851f10ce8b07
|
Provenance
The following attestation bundles were made for pytest_impacted-0.3.0.tar.gz:
Publisher:
publish-to-pypi.yml on promptromp/pytest-impacted
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytest_impacted-0.3.0.tar.gz -
Subject digest:
312ffd6a0bf5e94bb897161a76ee25aaefdde8bba00749958d30de9dbc13f019 - Sigstore transparency entry: 211734477
- Sigstore integration time:
-
Permalink:
promptromp/pytest-impacted@9cd6bc251c771e3f2a594f1356a5d80a4fd2dfba -
Branch / Tag:
refs/tags/0.3.0 - Owner: https://github.com/promptromp
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@9cd6bc251c771e3f2a594f1356a5d80a4fd2dfba -
Trigger Event:
push
-
Statement type:
File details
Details for the file pytest_impacted-0.3.0-py3-none-any.whl.
File metadata
- Download URL: pytest_impacted-0.3.0-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26c135a6548b76864aa0c36878d4f441cf5d2dfb88637107a1f645b2d4a979e3
|
|
| MD5 |
1307fc561a8dbc0bc787763021786f11
|
|
| BLAKE2b-256 |
0789eef3e62139bc9e05a407279ad9a9253cd180180cc6e084d48f9c701ac448
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytest_impacted-0.3.0-py3-none-any.whl -
Subject digest:
26c135a6548b76864aa0c36878d4f441cf5d2dfb88637107a1f645b2d4a979e3 - Sigstore transparency entry: 211734482
- Sigstore integration time:
-
Permalink:
promptromp/pytest-impacted@9cd6bc251c771e3f2a594f1356a5d80a4fd2dfba -
Branch / Tag:
refs/tags/0.3.0 - Owner: https://github.com/promptromp
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@9cd6bc251c771e3f2a594f1356a5d80a4fd2dfba -
Trigger Event:
push
-
Statement type: