A simple watcher for pytest

PyPI PyPI - Python Version GitHub


pytest-watcher is a tool to automatically rerun pytest when your code changes. It looks for the following events:

  • New *.py file created
  • Existing *.py file modified
  • Existing *.py file deleted

What about pytest-watch?

pytest-watch was around for a long time and was solving exactly this problem. Sadly, pytest-watch is not maintained anymore and not working for many users. I wrote this tool as a substitute

Install pytest-watcher

pip install pytest-watcher


Specify the path that you want to watch:

ptw .


ptw /home/repos/project

Any arguments after <path> will be forwarded to pytest:

ptw . -x --lf --nf


The utility is OS independent and should be able to work with any platform.

Code is tested for Python versions 3.6+