Doctest is a tool to test code in documentation to make sure the examples in docs run exactly as expected (input matches output, imports work, etc). Useful to make sure that your docs are up to date because it A) makes sure your examples are correct, and be if you are putting examples in your docs, it can keep your code and examples close to each other and still tested to keep everything close to each other to keep from drifting.
Doctest is a tool to test code in documentation to make sure the examples in docs run exactly as expected (input matches output, imports work, etc). Useful to make sure that your docs are up to date because it A) makes sure your examples are correct, and be if you are putting examples in your docs, it can keep your code and examples close to each other and still tested to keep everything close to each other to keep from drifting.