Created
April 3, 2014 14:44
-
-
Save durden/9955666 to your computer and use it in GitHub Desktop.
Demonstrate py.test failure
This file contains 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
def func_1(): | |
return ['a', 'b', 'c'] | |
def func_2(): | |
""" | |
>>> func_1() | |
['a', 'b', 'c'] | |
""" | |
pass | |
This file contains 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
py.test /tmp/test.py --doctest-modules | |
=========================================================================================== test session starts =========================================================================================== | |
platform darwin -- Python 2.7.6 -- py-1.4.20 -- pytest-2.5.2 | |
collected 1 items | |
../../../../tmp/test.py ['a', 'b', 'c'] | |
F | |
================================================================================================ FAILURES ================================================================================================= | |
__________________________________________________________________________________________ [doctest] test.func_2 __________________________________________________________________________________________ | |
005 """ | |
006 >>> func_1() | |
Expected: | |
['a', 'b', 'c'] | |
Got nothing | |
/tmp/test.py:6: DocTestFailure | |
======================================================================================== 1 failed in 0.02 seconds ========================================================================================= | |
py.test -s /tmp/test.py --doctest-modules | |
=========================================================================================== test session starts =========================================================================================== | |
platform darwin -- Python 2.7.6 -- py-1.4.20 -- pytest-2.5.2 | |
collected 1 items | |
../../../../tmp/test.py . | |
======================================================================================== 1 passed in 0.01 seconds ========================================================================================= |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment