https://github.com/fruch/pytest-diff-selector
https://github.com/fruch/pytest-diff-selector
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/fruch/pytest-diff-selector
- Owner: fruch
- License: mit
- Created: 2022-02-23T19:15:48.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-01-10T22:39:24.000Z (over 1 year ago)
- Last Synced: 2025-04-22T10:42:59.197Z (2 months ago)
- Language: Python
- Size: 47.9 KB
- Stars: 10
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pytest-diff-selector
## Quickstart
```bash
pip install pytest-diff-selectorcd [git-project-you-want-scanning]
selector HEAD^ # scan last commit
tests/test_something.py::test_01selector HEAD # scan unstaged/uncommited work
tests/test_something.py::test_01
```[](https://asciinema.org/a/sKnqi785oLwcezFnMv5klPZVM)
## Why
When having a long integration tests you want your CI extra smarter and don't waste time on irrelevant tests
# How
Figuring out which tests are affect by specific code changes
It's scanning all the project python files and build a call
graph using AST, and scans this graph to find paths that are
part to the change (by line numbers from the diff) that leads
to a testCurrently it's only a commandline tool, but it should become a full fledged pytest plugin