[SciPy-Dev] line endings in test failures?

Skipper Seabold jsseabold at gmail.com
Wed May 19 22:55:02 EDT 2010


I was working on some tests and I noticed that the AssertionError
raised by a test failure contains a line ending, '\n'.  I'm using
*Ubuntu/Linux, Python 2.6.5, and numpy version '2.0.0.dev8391'

Is this intended?  A nose issue?  Not a big deal I guess, but it makes
test output hard to read.

Here's an example of a failure in scipy version '0.8.0.dev6392'

======================================================================
FAIL: test_x_stride (test_fblas.TestCgemv)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/scipy/lib/blas/tests/test_fblas.py",
line 345, in test_x_stride
    assert_array_almost_equal(desired_y,y)
  File "/usr/local/lib/python2.6/dist-packages/numpy/testing/utils.py",
line 774, in assert_array_almost_equal
    header='Arrays are not almost equal')
  File "/usr/local/lib/python2.6/dist-packages/numpy/testing/utils.py",
line 618, in assert_array_compare
    raise AssertionError(msg)
AssertionError:
Arrays are not almost equal

(mismatch 33.3333333333%)
 x: array([ -1.93673837 +1.93673837j, -15.54586983+17.54586983j,
         2.03078222 +1.96921778j], dtype=complex64)
 y: array([ -1.93673837 +1.93673837j, -15.54586983+17.54587173j,
         2.03078222 +1.96921754j], dtype=complex64)
>>  raise AssertionError('\nArrays are not almost equal\n\n(mismatch 33.3333333333%)\n x: array([ -1.93673837 +1.93673837j, -15.54586983+17.54586983j,\n         2.03078222 +1.96921778j], dtype=complex64)\n y: array([ -1.93673837 +1.93673837j, -15.54586983+17.54587173j,\n         2.03078222 +1.96921754j], dtype=complex64)')

but just from the interpreter

>>> raise AssertionError('\n hello \n hello')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AssertionError:
 hello
 hello
>>>

Skipper



More information about the SciPy-Dev mailing list