Calmcode - entr: entr

Automatically run Pytest on File Update

1 2 3 4

When a Python files updates, we want to automatically run Pytest. To set this up, we will use entr.

Install entr

This video assumes that you've already installed entr. On MacOS you can run;

brew install entr

If you're running linux then you can build this yourself. If you're running ubuntu then you might also be able to install via:

sudo apt-get update
sudo apt-get install entr

Pytest and Entr

Either way, assuming you've got entr installed you can now automatically run the unit tests apon saving by running:

ls checking/*.py | entr pytest test.py::test_starts_correctly