Doctest failing

Thomas Jollans t at jollybox.de
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 books.py
**********************************************************************
File "books.py", line 12, in books.book_title
Failed example:
    book_title('the WORKS OF AleXANDer dumas')
Expected:
    'The Works of Alexander Dumas'
Got:
    '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?

Thomas



More information about the Python-list mailing list