[TIP] Docstrings in Test methods

Alfredo Deza alfredodeza at gmail.com
Sat Nov 5 19:10:17 PDT 2011


On Sat, Nov 5, 2011 at 6:50 PM, Kumar McMillan <kumar.mcmillan at gmail.com> wrote:
>
>
> On Sat, Nov 5, 2011 at 8:07 AM, Alfredo Deza <alfredodeza at gmail.com> wrote:
>>
>> But this would be for failing tests you say? This is what I would see
>> in Python2.6
>> and unittest 1.63
>>
>> $ python test_foo.py
>> F
>> ======================================================================
>> FAIL: when foo uses bar as a connection it should be True when successful
>> ----------------------------------------------------------------------
>> Traceback (most recent call last):
>>  File "test_foo.py", line 7, in test_foo_should_be_true
>>    assert False
>> AssertionError
>
> I don't use doctests on tests but when I do, I make sure I have this Nose
> plugin: https://github.com/kumar303/disable-docstring
>
> I'm pretty sure py.test never had this problem to begin with.

py.test doesn't care about docstrings, you are correct :)
>
>



More information about the testing-in-python mailing list