logo

... entr.


There are moments when you'd automatically want to run a script the moment that a file updates. Instead of running these things by hand we can use a nifty tool called entr to help us automate these things. The project page for this tool can be found here.


Notes

We've got a python project called checking that contains a file called web.py.

def valid_url(url: str):
    return True

We've also got a test file called called test.py.

from checking.web import valid_url

def test_starts_correctly():
    assert valid_url("http://yoyo.com")
    assert valid_url("https://yoyo.com")
    assert not valid_url("foobar.co")

We can run this unit test by running this command from the command line:

pytest test.py::test_starts_correctly

The goal of this series of videos will be to come up with a way to have this line of code run automatically whenever we make a change to web.py.


Feedback? See an issue? Something unclear? Feel free to mention it here.

If you want to be kept up to date, consider getting the newsletter.