How To Write Doctests in Python
Python’s standard library comes equipped with a test framework module called `doctest`. The `doctest` module programmatically searches Python code for pieces of text within comments that look like interactive Python sessions. Then, the module executes those sessions to confirm that the code referenced by a doctest runs as expected.