New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don’t use doctests anymore #2703
Conversation
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
@@ -469,9 +469,8 @@ class TemplateHookRegistry(object): | |||
>>> r = TemplateHookRegistry('foo', None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this still a doctest? Or do you want to keep it as documentation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn’t remove any doctests, because they’re still pretty good documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Out of curiosity: what exactly are the problems with doctests? I searched a bit on the net, but mostly found discussions from 2008 or so, so I was wondering whether there are new reasons.
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
Doctest suck because they’re just stringifying the return value and comparing it using string equality. Therefore:
Merging. (Ignore the test failures — that’s invariance, caused by this branch being created pre-v7.8.4) |
Ah, so nothing really new. |
Doctests are pretty fragile, require string trickery, and are frowned upon by many other people. Let’s drop them. This commit disables doctests and re-adds all the useful ones as regular unit tests.