Merge pull request #317 from tonysyu/testing-compatibility

Add `assert_greater` compatibility function.
This commit is contained in:
Johannes Schönberger
2012-09-17 22:34:26 -07:00
4 changed files with 30 additions and 3 deletions
+1 -1
View File
@@ -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
+26
View File
@@ -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