thegooglecodearchive / mpmath

Automatically exported from code.google.com/p/mpmath
Other
0 stars 0 forks source link

Improve test coverage #129

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
runtests.py -coverage

Lack of coverage quite often means bugs (and usually trivial bugs, so
improving coverage gives good payoff for little work).

   24    75%   mpmath.__init__   (c:\source\mp\trunk\mpmath\__init__.py)
  520    85%   mpmath.calculus   (c:\source\mp\trunk\mpmath\calculus.py)
  998    88%   mpmath.elliptic   (c:\source\mp\trunk\mpmath\elliptic.py)
  888    95%   mpmath.functions   (c:\source\mp\trunk\mpmath\functions.py)
  667    96%   mpmath.gammazeta   (c:\source\mp\trunk\mpmath\gammazeta.py)
  306    86%   mpmath.identification  
(c:\source\mp\trunk\mpmath\identification.py)
 1028    90%   mpmath.libelefun   (c:\source\mp\trunk\mpmath\libelefun.py)
  613    92%   mpmath.libhyper   (C:\source\mp\trunk\mpmath\libhyper.py)
  465    95%   mpmath.libmpc   (C:\source\mp\trunk\mpmath\libmpc.py)
  958    72%   mpmath.libmpf   (C:\source\mp\trunk\mpmath\libmpf.py)
  252    97%   mpmath.libmpi   (C:\source\mp\trunk\mpmath\libmpi.py)
  236    96%   mpmath.linalg   (c:\source\mp\trunk\mpmath\linalg.py)
  324    93%   mpmath.matrices   (c:\source\mp\trunk\mpmath\matrices.py)
  738    86%   mpmath.mptypes   (c:\source\mp\trunk\mpmath\mptypes.py)
   92    89%   mpmath.odes   (c:\source\mp\trunk\mpmath\odes.py)
  465    81%   mpmath.optimization  
(c:\source\mp\trunk\mpmath\optimization.py)
  268    83%   mpmath.quadrature   (c:\source\mp\trunk\mpmath\quadrature.py)
  100    79%   mpmath.settings   (C:\source\mp\trunk\mpmath\settings.py)
  105     9%   mpmath.visualization  
(c:\source\mp\trunk\mpmath\visualization.py)

Some modules are reported to have lower coverage than in reality because
they contain gmpy/non-gmpy-specific code. It should be easy to write some
tests that always test the non-gmpy code when in gmpy mode.

Some other code is only meant to be run interactively, but could still be
tested (e.g. for "verbose=True" code by temporarily redirecting stdout to
stringio).

Also, some code reported as uncovered here is already covered by doctests.
Nevertheless, near-100% coverage by runtests.py should be possible with a
little work.

Original issue reported on code.google.com by fredrik....@gmail.com on 5 Feb 2009 at 4:33

GoogleCodeExporter commented 9 years ago
Nice work!

When did you run the doctests the last time? I suspect many of them are broken.

Original comment by Vinzent.Steinberg@gmail.com on 5 Feb 2009 at 6:38

GoogleCodeExporter commented 9 years ago
A couple of days ago.

Running them now, all module tests pass. There are some failures in the .txt 
docs due
to the change of mpi.__repr__.

Original comment by fredrik....@gmail.com on 5 Feb 2009 at 6:57