Robert Bradshaw wrote: > On Feb 26, 2008, at 9:53 AM, Neal Becker wrote: >> FAIL: Doctest: unpacklistcomp >> ---------------------------------------------------------------------- >> File "/home/nbecker/Cython-0.9.6.12/BUILD/unpacklistcomp.so", line >> 84, in unpacklistcomp >> Failed example: >> unpack_normal([1,2,3]) >> Expected: >> Traceback (most recent call last): >> ValueError: too many values to unpack >> Got: >> Traceback (most recent call last): >> File "/usr/lib64/python2.5/doctest.py", line 1212, in __run >> compileflags, 1) in test.globs >> File "<doctest unpacklistcomp[1]>", line 1, in <module> >> unpack_normal([1,2,3]) >> File "unpacklistcomp.pyx", line 22, in >> unpacklistcomp.unpack_normal >> ValueError: unpack sequence of wrong size > > This is the correct error, but the actual message is different > depending on the version of Python. In Python 2.3 it is "ValueError: > unpack tuple of wrong size" but in Python 2.5 it is "ValueError: too > many values to unpack." > > Note sure how to best test for this.
You can add "# doctest: +ELLIPSIS" after the offending line and replace the exception message with "...", like this: >>> unpack_normal([1,2,3]) # doctest: +ELLIPSIS Traceback (most recent call last): ValueError: ... Stefan _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
