After having seen how to test in R.
Let’s see how to do the same in Python:
Writing a tests-oriented program
A good practice demand that we should try to write our test before we code the program we intended to.
At least, we can try to write the code in a way that is easier to test in the future. Trying to fight out natural tendency to write the tests after your code.
To do that try to follow these guidelines: