{"id":4216,"library":"pytest-watch","title":"Pytest Watch","description":"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.","status":"abandoned","version":"4.2.0","language":"en","source_language":"en","source_url":"https://github.com/joeyespo/pytest-watch","tags":["pytest","testing","watch","tdd","cli"],"install":[{"cmd":"pip install pytest-watch","lang":"bash","label":"Install Pytest Watch"}],"dependencies":[{"reason":"Core testing framework that pytest-watch runs.","package":"pytest","optional":false},{"reason":"Used for file system event monitoring.","package":"watchdog","optional":false}],"imports":[],"quickstart":{"code":"cd myproject\nptw","lang":"bash","description":"Navigate to your project directory and run 'ptw' (or 'pytest-watch') to start watching for file changes and re-running tests."},"warnings":[{"fix":"Consider migrating to `pytest-watcher` (pip install pytest-watcher) for an actively maintained alternative.","message":"The 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.","severity":"breaking","affected_versions":"4.x (especially with Python 3.11+ or newer pytest versions)"},{"fix":"Ensure critical configurations are in `pytest.ini` or consider using `pytest-watcher` which addresses this.","message":"pytest-watch has been reported to fail in parsing valid `pyproject.toml` files, which can affect how project configurations are recognized and applied.","severity":"gotcha","affected_versions":"All versions, likely more prominent with modern Python projects."},{"fix":"Run `ptw --wait` to ensure tests finish before interruption.","message":"By 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.","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"Users have reported issues with `pytest-watch` not reliably detecting changes in subdirectories or requiring explicit configuration for them.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}