mirror of
https://github.com/wassname/scikit-image.git
synced 2026-06-27 17:17:07 +08:00
Fix assertion in novice test for older numpy versions
For older versions of numpy, `assert_equal(a, b)` failed for arbitrary objects `a` and `b` even if they had ``__eq__`` defined. This is now fixed, but the test is changed to use ``assert_true(a == b)`` to be backward compatible.
This commit is contained in:
@@ -2,6 +2,7 @@ import os
|
||||
import tempfile
|
||||
|
||||
import numpy as np
|
||||
from nose.tools import assert_true
|
||||
from numpy.testing import assert_equal, raises, assert_allclose
|
||||
from skimage import novice
|
||||
from skimage.novice._novice import (array_to_xy_origin, xy_to_array_origin,
|
||||
@@ -140,7 +141,7 @@ def test_reset():
|
||||
v = pic[0, 0]
|
||||
pic[0, 0] = (1, 1, 1)
|
||||
pic.reset()
|
||||
assert_equal(pic[0, 0], v)
|
||||
assert_true(pic[0, 0] == v)
|
||||
|
||||
|
||||
def test_update_on_save():
|
||||
|
||||
Reference in New Issue
Block a user