mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-04 02:28:35 +08:00
Merge pull request #317 from tonysyu/testing-compatibility
Add `assert_greater` compatibility function.
This commit is contained in:
+1
-1
@@ -73,7 +73,7 @@
|
||||
From whom we borrowed the example generation tools.
|
||||
|
||||
- Andreas Mueller
|
||||
Example data set loader.
|
||||
Example data set loader. Nosetest compatibility functions.
|
||||
Quickshift image segmentation, Felzenszwalbs fast graph based segmentation.
|
||||
|
||||
- Yaroslav Halchenko
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
"""Testing utilities."""
|
||||
|
||||
|
||||
def _assert_less(a, b, msg=None):
|
||||
message = "%r is not lower than %r" % (a, b)
|
||||
if msg is not None:
|
||||
message += ": " + msg
|
||||
assert a < b, message
|
||||
|
||||
|
||||
def _assert_greater(a, b, msg=None):
|
||||
message = "%r is not greater than %r" % (a, b)
|
||||
if msg is not None:
|
||||
message += ": " + msg
|
||||
assert a > b, message
|
||||
|
||||
|
||||
try:
|
||||
from nose.tools import assert_less
|
||||
except ImportError:
|
||||
assert_less = _assert_less
|
||||
|
||||
try:
|
||||
from nose.tools import assert_greater
|
||||
except ImportError:
|
||||
assert_greater = _assert_greater
|
||||
@@ -1,6 +1,6 @@
|
||||
import numpy as np
|
||||
from numpy.testing import assert_equal, assert_array_equal
|
||||
from nose.tools import assert_greater
|
||||
from skimage._shared.testing import assert_greater
|
||||
from skimage.segmentation import felzenszwalb
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import numpy as np
|
||||
from numpy.testing import assert_equal, assert_array_equal
|
||||
from nose.tools import assert_true, assert_greater
|
||||
from nose.tools import assert_true
|
||||
from skimage._shared.testing import assert_greater
|
||||
from skimage.segmentation import quickshift
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user