I like doctest but when you have complex arguments that you need to set before you pass to a function it become really hard to read.. Hence, you start using multiple lines assigning then calling the function that you would like to test.. This approach however, will report that you have multiple tests rather then the real number of tests that you have.. An example will illustrate what I mean..
def returnme(x):
"""
Returns what you pass
>>> y = (2, 3, 5, 7)
>>> returnme(y)
(2, 3, 5, 7)
"""
return x
In the above snippet, there is only one test and the other is just a variable assignment, however, this is what gets reported..
Trying: y = (2, 3, 5, 7) Expecting nothing ok Trying: returnme(y) Expecting: (2, 3, 5, 7) ok 2 tests in 2 items. 2 passed and 0 failed.
I've looked at the flags documented, surely I missing something..