From 4b8de0203d2eec87c2d05c3521df8af3365f73a4 2012-06-01 10:01:51 From: Thomas Kluyver Date: 2012-06-01 10:01:51 Subject: [PATCH] Add assert_not_in method for Python2.6 --- diff --git a/IPython/testing/nose_assert_methods.py b/IPython/testing/nose_assert_methods.py index a5adef9..c50a7fe 100644 --- a/IPython/testing/nose_assert_methods.py +++ b/IPython/testing/nose_assert_methods.py @@ -9,3 +9,9 @@ def assert_in(item, collection): if not hasattr(nt, 'assert_in'): nt.assert_in = assert_in + +def assert_not_in(item, collection): + assert item not in collection, '%r in %r' % (item, collection) + +if not hasattr(nt, 'assert_not_in'): + nt.assert_not_in = assert_not_in