{"id":14836,"library":"pytest-incremental","title":"Pytest Incremental Test Runner","description":"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.","status":"deprecated","version":"0.6.0","language":"en","source_language":"en","source_url":"https://github.com/pytest-dev/pytest-incremental","tags":["pytest","testing","incremental","plugin","developer-tool"],"install":[{"cmd":"pip install pytest-incremental","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Required as a pytest plugin to function.","package":"pytest","optional":false},{"reason":"Used internally by the plugin for dependency tracking and result caching.","package":"doit","optional":false}],"imports":[],"quickstart":{"code":"import os\n\n# To use pytest-incremental, simply run pytest with the --inc flag.\n# Example command line usage:\n# pytest --inc\n\n# Alternatively, enable it by default in your pytest.ini:\n# [pytest]\n# addopts = --inc\n\n# To watch for changes in modules outside the current working directory:\n# pytest --inc --inc-path my_lib --inc-path ../py3rd-trunk/py3rd\n\n# To visualize detected dependencies (requires graphviz):\n# pytest --inc-graph-image\n","lang":"python","description":"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."},"warnings":[{"fix":"Consider migrating to 'rut' or an alternative incremental testing tool like 'pytest-testmon'.","message":"The pytest-incremental project is officially DEPRECATED and no longer maintained. A replacement project, 'rut' (built on unittest directly), is being developed by the original author. Users should consider migrating or using alternative incremental test runners.","severity":"breaking","affected_versions":"All versions"},{"fix":"Minimize dynamic import patterns and monkey-patching where possible in modules with test dependencies. Manually specify watched paths using `--inc-path` if dependencies are in non-standard locations.","message":"Pytest-incremental relies on AST analysis to detect dependencies. Dynamic aspects of Python, such as `importlib` usage, non-explicit imports, or extensive monkey-patching, may prevent it from accurately detecting all dependencies, leading to incomplete test runs or undetected changes.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Refactor your codebase to eliminate cyclic dependencies for better code maintainability and optimal performance with pytest-incremental.","message":"Projects with cyclic dependencies will negatively affect the efficacy of pytest-incremental, as any change in a module within a cycle may lead to all modules in the cycle (and their dependents) being re-executed.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Test thoroughly with your specific Python/pytest versions. Be aware that unaddressed compatibility issues may arise.","message":"The plugin was last officially tested with Python 3.6-3.9 and pytest 6.x. While it may still function with newer Python and pytest versions (e.g., pytest 8.3.3 with Python 3.10.12), compatibility is not guaranteed or officially supported due to the project's deprecated status.","severity":"gotcha","affected_versions":"0.6.0 and earlier with pytest > 6.x or Python > 3.9"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Install the plugin: `pip install pytest-incremental`","cause":"The 'pytest-incremental' plugin is not installed in the current environment or pytest cannot locate it.","error":"pytest: error: unrecognized arguments: --inc"},{"fix":"Review your codebase for dynamic import patterns or cyclic dependencies. Ensure your pytest and pytest-incremental versions are compatible. Consider enabling verbose output (`pytest --inc -v`) to understand what the plugin is doing. If issues persist, consider using the recommended replacement 'rut' or 'pytest-testmon'.","cause":"Pytest-incremental is not correctly detecting dependencies due to factors like dynamic imports, monkey-patching, cyclic dependencies, or an incompatibility with your current pytest version.","error":"Pytest is running all tests even when only a small change was made, or tests that should be skipped are still running."}],"ecosystem":"pypi"}