From cc2ccfb56071b37ced8b31677ac34be202b49605 2012-08-01 14:22:08 From: Bradley M. Froehle <brad.froehle@gmail.com> Date: 2012-08-01 14:22:08 Subject: [PATCH] Python 2.6: Add `assert_is_none`, `assert_is_not_none` to `nose.tools`. --- diff --git a/IPython/testing/nose_assert_methods.py b/IPython/testing/nose_assert_methods.py index c50a7fe..f41ad48 100644 --- a/IPython/testing/nose_assert_methods.py +++ b/IPython/testing/nose_assert_methods.py @@ -15,3 +15,15 @@ def assert_not_in(item, collection): if not hasattr(nt, 'assert_not_in'): nt.assert_not_in = assert_not_in + +def assert_is_none(obj): + assert obj is None, '%r is not None' % obj + +if not hasattr(nt, 'assert_is_none'): + nt.assert_is_none = assert_is_none + +def assert_is_not_none(obj): + assert obj is not None, '%r is None' % obj + +if not hasattr(nt, 'assert_is_not_none'): + nt.assert_is_not_none = assert_is_not_none