pytest-watch
Local continuous test runner with pytest and watchdog.
What it is and what it does
pytest-watch is a command-line tool that monitors your project directory and automatically re-runs pytest whenever a file changes. It eliminates the manual cycle of editing code, switching to a terminal, and running tests by hand—instead, tests run continuously in the background and notify you of pass/fail status. The tool is zero-config by default but can be customized via pytest.ini to ignore directories, adjust file extensions, run setup/teardown commands, or trigger external notifications.
The package relies on watchdog for file system monitoring. It offers a range of options including custom test runners, interactive debugger integration, and the ability to run arbitrary shell commands before tests, after tests, or on pass/fail events. However, the project is abandoned—last updated in May 2018 with no recent maintenance—which raises compatibility concerns with modern pytest and Python versions.
Use it for:
- Test-driven development workflow where you want tests to run automatically as you edit code without manual intervention.
- Debugging complex test failures by running tests continuously while iterating on fixes, with optional beep or desktop notifications on failure.
- Pre-commit validation by running a custom command after each test pass to enforce code quality checks or database cleanup.
- Development in virtual machines or containers where OS-level file events may not work reliably, using the --poll option for polling-based file monitoring.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Runs pytest continuously, re-executing tests whenever project files change, with optional notifications and custom commands on pass or fail.
No. The package is abandoned (last release May 2018, no commits since July 2022) and has high install friction due to source-only distribution and unspecified Python version support. While the core idea is sound, the lack of maintenance means it will likely fail on modern Python versions or with current pytest releases. Consider actively maintained alternatives before installing.
Install
pytest-watch on PyPI
pip
pip install pytest-watchuv
uv add pytest-watchpoetry
poetry add pytest-watchInstalling pytest-watch
Before you install
High install friction due to source distribution only. Package is abandoned—last release May 2018, no commits since July 2022, and no maintenance activity for many years. Relies on watchdog for file monitoring, which may have unmet system dependencies.
License in practice
MIT license is permissive and poses no restrictions on use, modification, or distribution in commercial or private projects.
Quickstart
$ pip install pytest-watch
$ cd myproject
$ ptw
# Watches for file changes and re-runs pytest automatically
Requires watchdog library and its system dependencies (varies by OS); no explicit Python version constraint specified in package metadata.
Verify before relying
- Whether watchdog's system-level file monitoring dependencies are documented or automatically resolved on all target platforms.
- Current compatibility with modern pytest versions and Python 3.x releases, given the package has not been updated since 2018.
- Whether the beep-on-failure feature and OS-specific notification commands still work on current systems.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | abandoned — 3,008 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 946,128/month — #4,666 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pytest-watch-4.2.0.tar.gz
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
pytest-watcherAutomatically reruns pytest (or another test…
permissive · top 5,000 on PyPI
doitdoit is a Python-based task automation and…
permissive · top 5,000 on PyPI
pytest-progressA pytest plugin that displays real-time test…
permissive · top 15,000 on PyPI
pytest-rerunfailuresA pytest plugin that automatically reruns…
copyleft · top 1,000 on PyPI
pytest-cacheA pytest plugin that persists test state across…
permissive · top 15,000 on PyPI
pytest-runnerEnables running pytest tests through setup.py…
permissive · top 1,000 on PyPI
watchfilesWatches file system changes and triggers…
permissive · top 1,000 on PyPI
pywatchmanpywatchman is a Python client for Watchman, a…
permissive · top 15,000 on PyPI
pytest-instafailA pytest plugin that displays test failures and…
permissive · top 5,000 on PyPI
pytest-catchlogA pytest plugin that automatically captures log…
permissive · top 15,000 on PyPI