Bug#673428: failing unittests (on stable Debian system)

Yaroslav Halchenko debian at onerussian.com
Fri May 18 16:47:17 UTC 2012


Package: python-quantities
Version: 0.10.1-1
Severity: minor
Tags: upstream

Since happens actually on squeeze   where no official quantities package
available -- minor severity but it still would be nice to have those issues
addressed since no upstream version rquirements seems to forbid use of
quantities in such environment:

$> nosetests quantities
....................................................F........................................../usr/lib/pymodules/python2.6/unittest2/case.py:349: DeprecationWarning: Use of a TestResult without an addExpectedFailure method is deprecated
  DeprecationWarning)
..F.......F.....E.........F.........
======================================================================
ERROR: test_nansum (quantities.tests.test_umath.TestUmath)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/quantities/tests/test_umath.py", line 24, in test_nansum
    self.assertQuantityEqual(np.nansum(c), 6 * pq.m)
  File "/usr/lib/pymodules/python2.6/numpy/lib/function_base.py", line 1434, in nansum
    return _nanop(np.sum, 0, a, axis)
  File "/usr/lib/pymodules/python2.6/numpy/lib/function_base.py", line 1353, in _nanop
    y[mask] = fill
  File "/usr/lib/python2.6/dist-packages/quantities/quantity.py", line 359, in __setitem__
    value = value.rescale(self._dimensionality)
  File "/usr/lib/python2.6/dist-packages/quantities/quantity.py", line 196, in rescale
    %(from_u._dimensionality, to_u._dimensionality)
ValueError: Unable to convert between units of "dimensionless" and "m"

======================================================================
FAIL: test_cumsum (quantities.tests.test_methods.TestQuantityMethods)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/quantities/tests/test_methods.py", line 144, in test_cumsum
    self.assertQuantityEqual(self.q.cumsum(), [1, 3, 6, 10] * pq.m)
  File "/usr/lib/python2.6/dist-packages/quantities/tests/common.py", line 44, in assertQuantityEqual
    "Dimensionalities are not equal (%s vs %s)%s" % (d1, d2, msg)
AssertionError: Dimensionalities are not equal (m**2 vs m)

======================================================================
FAIL: test_cumsum (quantities.tests.test_umath.TestUmath)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/quantities/tests/test_umath.py", line 33, in test_cumsum
    self.assertQuantityEqual(np.cumsum(self.q), [1, 3, 6, 10] * pq.J)
  File "/usr/lib/python2.6/dist-packages/quantities/tests/common.py", line 44, in assertQuantityEqual
    "Dimensionalities are not equal (%s vs %s)%s" % (d1, d2, msg)
AssertionError: Dimensionalities are not equal (J**2 vs J)

======================================================================
FAIL: test_gradient (quantities.tests.test_umath.TestUmath)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/quantities/tests/test_umath.py", line 44, in test_gradient
    self.assertQuantityEqual(l[0], [[2., 3.], [2., 3.]] * pq.J/pq.m)
  File "/usr/lib/python2.6/dist-packages/quantities/tests/common.py", line 44, in assertQuantityEqual
    "Dimensionalities are not equal (%s vs %s)%s" % (d1, d2, msg)
AssertionError: Dimensionalities are not equal (1/m vs J/m)

======================================================================
FAIL: test_trapz (quantities.tests.test_umath.TestUmath)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/quantities/tests/test_umath.py", line 56, in test_trapz
    self.assertQuantityEqual(np.trapz(self.q, dx = 1*pq.m), 7.5 * pq.J*pq.m)
  File "/usr/lib/python2.6/dist-packages/quantities/tests/common.py", line 44, in assertQuantityEqual
    "Dimensionalities are not equal (%s vs %s)%s" % (d1, d2, msg)
AssertionError: Dimensionalities are not equal (dimensionless vs m*J)

----------------------------------------------------------------------
Ran 131 tests in 0.901s

FAILED (errors=1, failures=4)

That was with python 2.6.6-3+squeeze6 and numpy 1:1.4.1-5



-- no debconf information





More information about the debian-science-maintainers mailing list