mirror of
https://github.com/wassname/scikit-image.git
synced 2026-06-28 19:17:18 +08:00
2cbe2e1f20
The testing functions taken from scikit-learn were in a file with a copyright assigned to Pietro, but Andreas was resposible for the specific lines that were copied.
27 lines
562 B
Python
27 lines
562 B
Python
"""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
|