Skip to content Skip to sidebar Skip to footer

Python Doctest Failed For Equal "expected" And "got"

I try to use doctest for my scenario: def cycle(*its): '''Return the cyclic iterator. >>> c = cycle([1,2,3]) >>> [next(c) for i in range(10)] [1,

Solution 1:

Check for hidden spaces or tabs just after the expected value. E.g.

[1, 2, 3, 1, 2, 3, 1, 2, 3, 1]___

You can see them easily selecting the whole expected line (even in your post above). Hope it helps

Post a Comment for "Python Doctest Failed For Equal "expected" And "got""