diff --git a/tests/common.py b/tests/common.py index 14ba135..873ef84 100644 --- a/tests/common.py +++ b/tests/common.py @@ -21,7 +21,6 @@ from nose import SkipTest from nose.tools import ( assert_equal, - assert_greater, assert_not_equal, assert_true, ) @@ -48,6 +47,7 @@ def assert_is_instance(obj, cls): try: from nose.tools import assert_is_none + from nose.tools import assert_is_not_none except ImportError: # Python 2.6: def assert_is_none(obj): @@ -55,6 +55,21 @@ def assert_is_none(obj): obj is None, msg='{0!r} is not None'.format(obj) ) + def assert_is_not_none(obj): + assert_true( + obj is not None, + msg='{0!r} is not None'.format(obj) + ) + +try: + from nose.tools import assert_greater +except ImportError: + # Python 2.6: + def assert_greater(x, y): + assert_true( + x > y, + msg='{0!r} not greater than {1!r}'.format(x, y) + ) def assert_regexp_matches(regexp, text): if isinstance(regexp, basestring): diff --git a/tests/test_version.py b/tests/test_version.py index 6be8ce7..8aa541d 100644 --- a/tests/test_version.py +++ b/tests/test_version.py @@ -15,7 +15,7 @@ import re import xml.etree.cElementTree as etree -from nose.tools import ( +from . common import ( assert_equal, assert_is_instance, assert_is_not_none,