mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-01 11:27:19 +08:00
f2d5b109e9
Fix tests to work with nose < 1.1.3. Compatibility functions borrowed from scikit-learn.
29 lines
623 B
Python
29 lines
623 B
Python
"""Testing utilities."""
|
|
|
|
# Copyright (c) 2011 Pietro Berkes
|
|
# License: Simplified BSD
|
|
|
|
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
|