Pytest Incremental Test Runner

0.6.0 · deprecated · verified Thu Apr 16

Pytest-incremental is a pytest plugin designed to accelerate test execution by identifying and running only the tests affected by recent code changes. It achieves this by analyzing project structure and file modifications between test runs, reordering test execution and de-selecting unaffected tests. The project is currently at version 0.6.0, but it is officially deprecated and no longer actively maintained.

Common errors

Warnings

Install

Quickstart

The plugin is activated via a command-line flag or `pytest.ini` configuration. No direct Python imports are typically made in test files for the plugin itself. You primarily interact with it through the `pytest` CLI.

import os

# To use pytest-incremental, simply run pytest with the --inc flag.
# Example command line usage:
# pytest --inc

# Alternatively, enable it by default in your pytest.ini:
# [pytest]
# addopts = --inc

# To watch for changes in modules outside the current working directory:
# pytest --inc --inc-path my_lib --inc-path ../py3rd-trunk/py3rd

# To visualize detected dependencies (requires graphviz):
# pytest --inc-graph-image

view raw JSON →