Registry / testing / pytest-watch

pytest-watch

JSON →
library4.2.0pypypiunverified

pytest-watch is a zero-config command-line interface (CLI) tool that continuously runs `pytest` and automatically re-executes tests when relevant files in your project change. It enhances the testing workflow by providing features such as audible beeps on test failures and the ability to run custom commands before or after test executions. Although it reached version 4.2.0, the project is considered unmaintained, with its official GitHub repository and PyPI page providing the primary documentation.

pip install pytest-watch
INSTALL
IMPORT
SIG · PYTEST-WATCH
P
pytest-watch
testingpythonv4.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Navigate to your project directory and run 'ptw' (or 'pytest-watch') to start watching for file changes and re-running tests.

cd myproject ptw
ptw --version
Debug
Known issues
breakingThe project is no longer actively maintained and has known compatibility issues with newer Python or `pytest` versions, often leading to installation or runtime errors. An alternative, `pytest-watcher`, was developed specifically because `pytest-watch` is unmaintained and problematic for many users.
fix
Consider migrating to `pytest-watcher` (pip install pytest-watcher) for an actively maintained alternative.
affects: 4.x (especially with Python 3.11+ or newer pytest versions)
gotchapytest-watch has been reported to fail in parsing valid `pyproject.toml` files, which can affect how project configurations are recognized and applied.
fix
Ensure critical configurations are in `pytest.ini` or consider using `pytest-watcher` which addresses this.
affects: All versions, likely more prominent with modern Python projects.
gotchaBy default, `pytest-watch` will interrupt ongoing tests if a new file system event occurs. To ensure tests complete their execution before re-running, the `--wait` command-line option must be used.
fix
Run `ptw --wait` to ensure tests finish before interruption.
affects: All versions
gotchaUsers have reported issues with `pytest-watch` not reliably detecting changes in subdirectories or requiring explicit configuration for them.
fix
Explicitly specify directories to watch using `ptw <dir1> <dir2>...` or consider alternative solutions if issues persist. Check `pytest-watch`'s `--ignore` option, which also affects watching.
affects: All versions
Upgrade
Version history
4.2.0latest on PyPI · released May 20, 2018
Audit
Dependencies
pytestrequiredCore testing framework that pytest-watch runs.
watchdogrequiredUsed for file system event monitoring.
Agent activity
5 hits · last 30 days
node
4
Resources
pytest-watch — pip install pytest-watch · libregistry