Testing your code is a good idea because it usually leads to great improvements. There's many libraries in python that will help with testing but a favourable one called pytest.
In the linked video you will learn: