gmpy 1.0 for python 2.4 alpha 2 Windows-packaged

David Bolen db3l at fitlinxx.com
Fri Sep 3 20:24:21 CEST 2004


aleaxit at yahoo.com (Alex Martelli) writes:

> I do assume that it's easy to keep the hundreds of tests almost
> unchanged, to avoid having to maintain them separately in two versions,
> and support 2.3 and 2.4 with localized changes to the small spots where
> the tests are run...?

At least when I ran it, the tests themselves (the doctest.testmod)
calls worked fine.  The rand exceptions seemed to just be a difference
in reporting in 2.4, for example most of them were of the form:

          - - - - - - - - - - - - - - - - - - - - - - - - -
Failure in example: r('error',1,2,3)
from line #2 of gmpy_test_rnd.rand in e:\usr\src\gmpy\test\gmpy_test_rnd.pyc
Expected:
    Traceback (most recent call last):
    File "<string>", line 1, in ?
    TypeError: function takes exactly 2 arguments (4 given)
Got:
    Traceback (most recent call last):
    TypeError: function takes exactly 2 arguments (4 given)
          - - - - - - - - - - - - - - - - - - - - - - - - -

However, when I try one of those tests interactively, Python 2.4 seems
to give me the "File" line too (indented, but it's also indented under
2.3, so I'm assuming the lack of indentation is unimportant to
doctest).  So I guess I can't say for sure that this isn't something
impacted by a change in doctest.  The doctest module docs for both 2.3
and 2.4 seem to imply it should only be checking the exception
type/value (the last line), so I guess I don't know why it's failing.
At least to me it seems clearly to be the right exception.

The one failure that I don't think you could easily anticipate is a
change in the actual exception message - for example the "r('shuf',
'astring')" test wants a TypeError saying "object doesn't support item
assignment", but 2.4 changes that to "object does not support item
assignment".

-- David



More information about the Python-list mailing list