Testing that an Exception is Raised

Previously we tested that the
validate_url() function
returns the given URL if it’s a valid URL. If the given URL is not valid then
validate_url() is supposed to raise a ValueError exception.
To test this we need to use pytest.raises().
Here is a test that expectsvalidate_url() to raise a ValueError: