summaryrefslogtreecommitdiff
path: root/test/backunittest.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2012-11-10 18:19:25 -0500
committerNed Batchelder <ned@nedbatchelder.com>2012-11-10 18:19:25 -0500
commit99480be7da89cb82cfff01e5d10a2514546faf39 (patch)
tree1268826ee7f83571ec20a7074edbb5c19aeb2224 /test/backunittest.py
parentf52b43321aad4c8e50bafbfbe95f1e7e570b4b8d (diff)
downloadpython-coveragepy-git-99480be7da89cb82cfff01e5d10a2514546faf39.tar.gz
Add in assertNotIn.
Diffstat (limited to 'test/backunittest.py')
-rw-r--r--test/backunittest.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/backunittest.py b/test/backunittest.py
index 84a7f36e..3723dea4 100644
--- a/test/backunittest.py
+++ b/test/backunittest.py
@@ -36,6 +36,13 @@ class TestCase(unittest.TestCase):
msg = msg or ('%r not found in %r' % (member, container))
self.fail(msg)
+ if _need('assertNotIn'):
+ def assertNotIn(self, member, container, msg=None):
+ """Assert that `member` is not in `container`."""
+ if member in container:
+ msg = msg or ('%r found in %r' % (member, container))
+ self.fail(msg)
+
if _need('assertRaisesRegexp'):
def assertRaisesRegexp(self, excClass, regexp, callobj, *args, **kw):
""" Just like unittest.TestCase.assertRaises,