[Numpy-discussion] Odd nosetest error in test_umath.py

Matthew Brett matthew.brett@gmail....
Thu Jul 23 17:56:18 CDT 2009


Hi,

I just got an email about a broken buildbot build.  Looking at the
logs, I see this:

======================================================================
FAIL: Test bug in reduceat with structured arrays copied for speed.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/python-support/python2.5/nose/case.py", line 182, in runTest
    self.test(*self.arg)
  File "/home/numpybb/Buildbot/numpy/b14/numpy-install/lib/python2.5/site-packages/numpy/core/tests/test_umath.py",
line 818, in test_reduceat
    assert_array_almost_equal(h1, h2)
  File "../numpy-install/lib/python2.5/site-packages/numpy/testing/utils.py",
line 537, in assert_array_almost_equal
  File "../numpy-install/lib/python2.5/site-packages/numpy/testing/utils.py",
line 395, in assert_array_compare
AssertionError:
Arrays are not almost equal

(mismatch 100.0%)
 x: array([  701.1171875,   801.1171875,  1001.1171875,
7501.1171875], dtype=float32)
 y: array([  700.,   800.,  1000.,  7500.], dtype=float32)

I'm posting because I saw this bug before on one of my own machines.
It is an extremely strange error that  seemed to occur in the
following circumstances:

1) Running via nosetests
2) With one or more other tests in the same file as the test above,
where the test was a TestCase class
3) With nose 0.10.3, 0.10.4, but not 0.11

The error given seemed to be reliable, but differed in the numbers
given for different versions of the test file (but stayed the same for
any given version when the test was repeated)

Consider this example on my own machine:

mb312@fedora11:~$ nosetests sp/numpy/core/tests/test_umath.py
...
(mismatch 100.0%)
 x: array([  800.,   900.,  1100.,  7600.], dtype=float32)
 y: array([  700.,   800.,  1000.,  7500.], dtype=float32)

----------------------------------------------------------------------
Ran 71 tests in 0.064s

FAILED (errors=1, failures=1)

(where the error is a SkipTest).

Now, just running the failing test via nose:

mb312@fedora11:~$ nosetests sp/numpy/core/tests/test_umath.py:test_reduceat
.
----------------------------------------------------------------------
Ran 1 test in 0.001s

OK

I'm flagging it in case y'all run into it, and in case someone knows
what it means, and whether it is a problem.  It does not occur, as I
mentioned, for nose 0.11

Matthew


More information about the NumPy-Discussion mailing list