Skip to main content

Get tests affected by code changes (using git)

Project description

pytest-diff-selector

Quickstart

pip install pytest-diff-selector

cd [git-project-you-want-scanning]
selector HEAD^  # scan last commit
tests/test_something.py::test_01

selector HEAD   # scan unstaged/uncommited work
tests/test_something.py::test_01

asciicast

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 test

Currently it's only a commandline tool, but it should become a full fledged pytest plugin

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-diff-selector-0.1.3.tar.gz (8.4 kB view hashes)

Uploaded Source

Built Distribution

pytest_diff_selector-0.1.3-py2.py3-none-any.whl (5.9 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page