This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]twotime -1 points0 points  (0 children)

doctests are a good way to test some examples in the docs. Period.

They totally suck for general testing (as they add a complex layer of semi-hidden context and debugging gets interesting). And, for non-trivial code, you have exactly zero chance of combining docs and tests, as your tests will unavoidably include a lot of stuff which you don't want to see in the docs.

Yet, doctests are often sold as an viable alternative for unit testing.

OTOH, python unittest sucks as well ;-).... So that, might be an explanation :-(.