When testing scipy using the nose package using scipy.test(), the test fails under Ubuntu 12.04 with all the vanilla packages installed. Do I have to worry, and if yes how can I fix this?
In [8]: scipy.test()
Running unit tests for scipy
NumPy version 1.5.1
NumPy is installed in /usr/lib/python2.7/dist-packages/numpy
SciPy version 0.9.0
SciPy is installed in /usr/lib/python2.7/dist-packages/scipy
Python version 2.7.2+ (default, Jan 21 2012, 23:31:34) [GCC 4.6.2]
nose version 1.1.2
[................]
======================================================================
FAIL: test_io.test_imread
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/usr/lib/python2.7/dist-packages/numpy/testing/decorators.py", line 146, in skipper_func
return f(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/scipy/ndimage/tests/test_io.py", line 16, in test_imread
assert_array_equal(img.shape, (300, 420, 3))
File "/usr/lib/python2.7/dist-packages/numpy/testing/utils.py", line 686, in assert_array_equal
verbose=verbose, header='Arrays are not equal')
File "/usr/lib/python2.7/dist-packages/numpy/testing/utils.py", line 579, in assert_array_compare
raise AssertionError(msg)
AssertionError:
Arrays are not equal
(shapes (2,), (3,) mismatch)
x: array([300, 420])
y: array([300, 420, 3])
----------------------------------------------------------------------
Ran 3780 tests in 32.328s
FAILED (KNOWNFAIL=11, SKIP=20, failures=1)
If you take a look inside
/usr/lib/python2.7/dist-packages/scipy/ndimage/tests/test_io.pyyou should see:This test seems to be testing if
flatten=Trueconverts an RGB image into a 1-bit greyscale image.On my Ubuntu 11.10 system, however, dots.png is already a 1-bit image file:
If I perform the test (manually) on a RGBA image, then the test works:
So I don’t think there is anything seriously wrong here, just that perhaps the
dots.pngfile that was shipped should have been an RGB image instead of a greyscale one.