Has anyone here found some helpful uses of the doctest test module? I’m looking at the doctest docs. It’s interesting because it looks like it’s meant to handle exceptions. What I don’t understand is, if you’re generating the docstring from loading your module at the interepreter, won’t your doctest miss on any flaws because it’s producing the same output as what’s in your docstring?
What I mean is, doctest is basically doing the same test that you are doing, using your code. If your code is flawed, the doctest will be flawed too, and that means doctest will not tell you there’s a problem. It only tells you there’s a problem if the output it gets is different from your docstring
Here are the sites I’ve been reading on doctest
https://docs.python.org/2/library/doctest.html
https://www.python-course.eu/python3_tests.php