andyvand / gmpy

Automatically exported from code.google.com/p/gmpy
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Test failures with Python 3.2.2 #50

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Running the test suite with a fresh Python 3.2.2 install (from CPython's 3.2 
branch) produces the following test failures:

$ python3 gmpy_test.py 
Unit tests for gmpy 1.14
    on Python 3.2.2+ (3.2:9ef20fbd340f, Oct 15 2011, 21:22:07) 
[GCC 4.5.2]
Testing gmpy 1.14 (GMP 5.0.1), default caching (100, 128)
gmpy_test_cvr 148 tests, 0 failures
**********************************************************************
File "/home/antoine/gmpy-1.14/test3/gmpy_test_rnd.py", line ?, in 
gmpy_test_rnd.__test__.rand
Failed example:
    for i in range(3):
        print(float(r('floa')))
Expected:
    0.44833278656
    0.547296524048
    0.895370483398
Got:
    0.4483327865600586
    0.5472965240478516
    0.8953704833984375
**********************************************************************
1 items had failures:
   1 of  25 in gmpy_test_rnd.__test__.rand
***Test Failed*** 1 failures.
gmpy_test_rnd  26 tests, 1 failures
**********************************************************************
1 items had failures:
   1 of  25 in gmpy_test_rnd.__test__.rand
***Test Failed*** 1 failures.
gmpy_test_mpf 340 tests, 0 failures
**********************************************************************
File "/home/antoine/gmpy-1.14/test3/gmpy_test_mpq.py", line ?, in 
gmpy_test_mpq.__test__.power
Failed example:
    print(float(_g.mpf('0.2')**2))
Expected:
    0.04
Got:
    0.039999999999999994
**********************************************************************
2 items had failures:
   2 of  18 in gmpy_test_mpq.__test__.power
   1 of  25 in gmpy_test_rnd.__test__.rand
***Test Failed*** 3 failures.
gmpy_test_mpq 276 tests, 2 failures
**********************************************************************
2 items had failures:
   2 of  18 in gmpy_test_mpq.__test__.power
   1 of  25 in gmpy_test_rnd.__test__.rand
***Test Failed*** 3 failures.
gmpy_test_mpz 690 tests, 0 failures
**********************************************************************
2 items had failures:
   2 of  18 in gmpy_test_mpq.__test__.power
   1 of  25 in gmpy_test_rnd.__test__.rand
***Test Failed*** 3 failures.
gmpy_test_dec  24 tests, 0 failures
7 items had no tests:
    gmpy_test_cvr._test
    gmpy_test_dec._test
    gmpy_test_mpf._test
    gmpy_test_mpq._test
    gmpy_test_mpz._memsize
    gmpy_test_mpz._test
    gmpy_test_rnd._test
33 items passed all tests:
   4 tests in gmpy_test_cvr
  11 tests in gmpy_test_cvr.__test__.infinity
   7 tests in gmpy_test_cvr.__test__.misc_stuff
 126 tests in gmpy_test_cvr.__test__.user_errors
   1 tests in gmpy_test_dec
   8 tests in gmpy_test_dec.__test__.compat
  15 tests in gmpy_test_dec.__test__.elemop
   2 tests in gmpy_test_mpf
  60 tests in gmpy_test_mpf.__test__.binio
  84 tests in gmpy_test_mpf.__test__.cmpr
 116 tests in gmpy_test_mpf.__test__.elemop
  70 tests in gmpy_test_mpf.__test__.format
   8 tests in gmpy_test_mpf.__test__.newdiv
   2 tests in gmpy_test_mpq
  18 tests in gmpy_test_mpq.__test__.binio
  40 tests in gmpy_test_mpq.__test__.cmpr
  30 tests in gmpy_test_mpq.__test__.compat
  90 tests in gmpy_test_mpq.__test__.elemop
  54 tests in gmpy_test_mpq.__test__.format
  24 tests in gmpy_test_mpq.__test__.qdiv
   4 tests in gmpy_test_mpz
  36 tests in gmpy_test_mpz.__test__.binio
  66 tests in gmpy_test_mpz.__test__.bitops
  80 tests in gmpy_test_mpz.__test__.cmpr
  10 tests in gmpy_test_mpz.__test__.divexact
  30 tests in gmpy_test_mpz.__test__.divmod
  88 tests in gmpy_test_mpz.__test__.elemop
  36 tests in gmpy_test_mpz.__test__.format
   4 tests in gmpy_test_mpz.__test__.index
 150 tests in gmpy_test_mpz.__test__.number
 182 tests in gmpy_test_mpz.__test__.special
   4 tests in gmpy_test_mpz.factorize
   1 tests in gmpy_test_rnd
**********************************************************************
2 items had failures:
   2 of  18 in gmpy_test_mpq.__test__.power
   1 of  25 in gmpy_test_rnd.__test__.rand
1504 tests in 42 items.
1501 passed and 3 failed.
***Test Failed*** 3 failures.

Original issue reported on code.google.com by antoine.pitrou on 1 Dec 2011 at 10:47

GoogleCodeExporter commented 9 years ago
This is test suite issue caused by the changes in float formating in Python 
3.2. I'm working on a new release and I'll try to find a way to change the test 
suite. If you are looking for properly rounded floating point arithmetic, the 
SVN version of gmpy2 supports the MPFR and MPC libraries and they much better 
floating point support.

Original comment by casevh on 5 Dec 2011 at 1:44

GoogleCodeExporter commented 9 years ago
I've released 1.15 which fixes the formatting issues in the tests.

Original comment by casevh on 13 Jan 2012 at 6:59