aleaxit / gmpy

General Multi-Precision arithmetic for Python 2.6+/3+ (GMP, MPIR, MPFR, MPC)
https://gmpy2.readthedocs.io/en/latest/
GNU Lesser General Public License v3.0
516 stars 86 forks source link

2 tests fail #403

Closed yurivict closed 1 year ago

yurivict commented 1 year ago
===>  Testing for py39-gmpy2-2.1.5
===>   py39-gmpy2-2.1.5 depends on package: py39-pytest>=7,1 - found
===>   py39-gmpy2-2.1.5 depends on file: /usr/local/bin/python3.9 - found
========================================================================================== test session starts ==========================================================================================
platform freebsd13 -- Python 3.9.16, pytest-7.2.1, pluggy-1.0.0
rootdir: /usr/ports/math/py-gmpy2/work-py39/gmpy2-2.1.5
plugins: xdist-2.5.0, flaky-3.7.0, hypothesis-6.65.2, typeguard-3.0.2, forked-1.4.0
collected 69 items / 2 errors                                                                                                                                                                           

================================================================================================ ERRORS =================================================================================================
_______________________________________________________________________________ ERROR collecting test/test_gmpy2_cmp.txt ________________________________________________________________________________
/usr/local/lib/python3.9/doctest.py:675: in get_doctest
    return DocTest(self.get_examples(string, name), globs,
/usr/local/lib/python3.9/doctest.py:689: in get_examples
    return [x for x in self.parse(string, name)
/usr/local/lib/python3.9/doctest.py:651: in parse
    self._parse_example(m, name, lineno)
/usr/local/lib/python3.9/doctest.py:732: in _parse_example
    options = self._find_options(source, name, lineno)
/usr/local/lib/python3.9/doctest.py:761: in _find_options
    raise ValueError('line %r of the doctest for %s '
E   ValueError: line 67 of the doctest for test_gmpy2_cmp.txt has an invalid option: '+SKIP_MPC_LESS_THAN_110'
__________________________________________________________________________________ ERROR collecting test/test_mpc.txt ___________________________________________________________________________________
/usr/local/lib/python3.9/doctest.py:675: in get_doctest
    return DocTest(self.get_examples(string, name), globs,
/usr/local/lib/python3.9/doctest.py:689: in get_examples
    return [x for x in self.parse(string, name)
/usr/local/lib/python3.9/doctest.py:651: in parse
    self._parse_example(m, name, lineno)
/usr/local/lib/python3.9/doctest.py:732: in _parse_example
    options = self._find_options(source, name, lineno)
/usr/local/lib/python3.9/doctest.py:761: in _find_options
    raise ValueError('line %r of the doctest for %s '
E   ValueError: line 259 of the doctest for test_mpc.txt has an invalid option: '+SKIP_MPC_LESS_THAN_110'
======================================================================================== short test summary info ========================================================================================
ERROR test/test_gmpy2_cmp.txt - ValueError: line 67 of the doctest for test_gmpy2_cmp.txt has an invalid option: '+SKIP_MPC_LESS_THAN_110'
ERROR test/test_mpc.txt - ValueError: line 259 of the doctest for test_mpc.txt has an invalid option: '+SKIP_MPC_LESS_THAN_110'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=========================================================================================== 2 errors in 1.69s ===========================================================================================

Version: 2.1.5 Python-3.9 FreeBSD 13.1

skirpichev commented 1 year ago

How you run tests?

yurivict commented 1 year ago

pytest is run from the repository root.

skirpichev commented 1 year ago

There is only initial support for pytest, see #377. You should invoke instead test/runtests.py (see GA workflows), e.g.:

$ python test/runtests.py 

Unit tests for gmpy2 2.2.0 with Python 3.11.1+
  Mutliple-precision library:     GMP 6.2.1
  Floating-point library:         MPFR 4.1.0
  Complex library:                MPC 1.3.1

Results for:  test_context              Attempted:   38   Failed:    0
Results for:  test_gmpy2_abs            Attempted:   83   Failed:    0
Results for:  test_gmpy2_add            Attempted:   82   Failed:    0
Results for:  test_gmpy2_binary         Attempted:  106   Failed:    0
Results for:  test_gmpy2_cmp            Attempted:   41   Failed:    0
Results for:  test_gmpy2_comp           Attempted:   89   Failed:    0
Results for:  test_gmpy2_const          Attempted:   33   Failed:    0
Results for:  test_gmpy2_constructors   Attempted:   34   Failed:    0
Results for:  test_gmpy2_convert        Attempted:   50   Failed:    0
Results for:  test_gmpy2_divmod         Attempted:   48   Failed:    0
Results for:  test_gmpy2_floordiv       Attempted:   72   Failed:    0
Results for:  test_gmpy2_format         Attempted:  102   Failed:    0
Results for:  test_gmpy2_fused          Attempted:   18   Failed:    0
Results for:  test_gmpy2_lucas          Attempted:   23   Failed:    0
Results for:  test_gmpy2_math           Attempted:  147   Failed:    0
Results for:  test_gmpy2_minus          Attempted:   16   Failed:    0
Results for:  test_gmpy2_mpfr_misc      Attempted:   85   Failed:    0
Results for:  test_gmpy2_mpq_misc       Attempted:   38   Failed:    0
Results for:  test_gmpy2_mpq_misc_py3   Attempted:    3   Failed:    0
Results for:  test_gmpy2_mpz_bitops     Attempted:  120   Failed:    0
Results for:  test_gmpy2_mpz_divmod     Attempted:   67   Failed:    0
Results for:  test_gmpy2_mpz_divmod2exp Attempted:   66   Failed:    0
Results for:  test_gmpy2_mpz_inplace    Attempted:   87   Failed:    0
Results for:  test_gmpy2_mpz_misc       Attempted:  252   Failed:    0
Results for:  test_gmpy2_mpz_misc_py3   Attempted:   19   Failed:    0
Results for:  test_gmpy2_mul            Attempted:   68   Failed:    0
Results for:  test_gmpy2_muldiv_2exp    Attempted:   24   Failed:    0
Results for:  test_gmpy2_plus           Attempted:   16   Failed:    0
Results for:  test_gmpy2_pow            Attempted:   62   Failed:    0
Results for:  test_gmpy2_predicate      Attempted:  124   Failed:    0
Results for:  test_gmpy2_prp            Attempted:   57   Failed:    0
Results for:  test_gmpy2_root           Attempted:   23   Failed:    0
Results for:  test_gmpy2_square         Attempted:   20   Failed:    0
Results for:  test_gmpy2_sub            Attempted:   83   Failed:    0
Results for:  test_gmpy2_xmpz_inplace   Attempted:   79   Failed:    0
Results for:  test_gmpy2_xmpz_limbs     Attempted:   21   Failed:    0
Results for:  test_gmpy2_xmpz_misc      Attempted:   59   Failed:    0
Results for:  test_misc                 Attempted:   10   Failed:    0
Results for:  test_mpc                  Attempted:  133   Failed:    0
Results for:  test_mpc_create           Attempted:    7   Failed:    0
Results for:  test_mpc_trig             Attempted:   21   Failed:    0
Results for:  test_mpfr                 Attempted:  228   Failed:    0
Results for:  test_mpfr4_fused          Attempted:   15   Failed:    0
Results for:  test_mpfr4_random         Attempted:    7   Failed:    0
Results for:  test_mpfr_create          Attempted:   73   Failed:    0
Results for:  test_mpfr_min_max         Attempted:   26   Failed:    0
Results for:  test_mpfr_subnormalize    Attempted:   17   Failed:    0
Results for:  test_mpfr_trig            Attempted:  140   Failed:    0
Results for:  test_mpq                  Attempted:  203   Failed:    0
Results for:  test_mpz                  Attempted:  249   Failed:    0
Results for:  test_mpz_create           Attempted:   63   Failed:    0
Results for:  test_mpz_io               Attempted:   60   Failed:    0
Results for:  test_mpz_pack_unpack      Attempted:   22   Failed:    0
Results for:  test_py32_hash            Attempted:   17   Failed:    0

                              Summary - Attempted: 3646   Failed:    0

Running external test programs.
===================================================================== test session starts =====================================================================
platform linux -- Python 3.11.1+, pytest-7.2.1, pluggy-1.0.0
rootdir: /home/sk/src/gmpy, configfile: pyproject.toml
plugins: hypothesis-6.66.1
collected 15 items                                                                                                                                            

test/test_mpfr.py .                                                                                                                                     [  6%]
test/test_mpq.py .....                                                                                                                                  [ 40%]
test/test_mpz.py .........                                                                                                                              [100%]

==================================================================== slowest 10 durations =====================================================================
7.03s call     test/test_mpz.py::test_mpz_from_bytes
5.31s call     test/test_mpz.py::test_mpz_to_bytes
4.99s call     test/test_mpz.py::test_mpz_arithmetics
4.64s call     test/test_mpz.py::test_mpz_pack_unpack
0.04s call     test/test_mpq.py::test_mpq_pickling

(5 durations < 0.005s hidden.  Use -vv to show these durations.)
===================================================================== 15 passed in 23.96s =====================================================================
Running pytest                          successful

Lets me know if you will have troubles on this way. If not, probably there is no issue.

yurivict commented 1 year ago

This works, thanks!