Last active
August 29, 2015 13:58
-
-
Save osantana/10216770 to your computer and use it in GitHub Desktop.
Bug(?) in Python doctest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding: utf-8 | |
""" | |
The following test should pass, but it fails: | |
>>> def spam(): | |
... print("eggs") | |
... | |
>>> assert spam(), "Print 'eggs' before AssertionError" | |
eggs | |
Traceback (most recent call last): | |
... | |
AssertionError: Print 'eggs' before AssertionError | |
""" | |
import doctest | |
if __name__ == "__main__": | |
doctest.testmod() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment