Doctest failing

Thomas Jollans t at
Sat Sep 10 13:50:14 CEST 2011

On 10/09/11 13:20, Tigerstyle wrote:
> Hi guys.
> I'm strugglin with some homework stuff and am hoping you can help me
> out here.
> All tests are failing even though I am getting the correct output on
> the first two tests. And the last test still gives me "Of" instead of
> "of"

Cannot reproduce. I only get the one, expected, failure.

% python -m doctest
File "", line 12, in books.book_title
Failed example:
    book_title('the WORKS OF AleXANDer dumas')
    'The Works of Alexander Dumas'
    'The Works Of Alexander Dumas'
1 items had failures:
   1 of   3 in books.book_title
***Test Failed*** 1 failures.

> def _test():
>     import doctest, refactory
>     return doctest.testmod(refactory)
> if __name__ == "__main__":
>     _test()

What is this "refactory"? Are you testing the right code? What is the
output of your test - does it make sense for the module?


More information about the Python-list mailing list