summaryrefslogtreecommitdiff
path: root/test/test_testing.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_testing.py')
-rw-r--r--test/test_testing.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/test_testing.py b/test/test_testing.py
index 67eb9456..d909021b 100644
--- a/test/test_testing.py
+++ b/test/test_testing.py
@@ -94,7 +94,7 @@ class TestingTest(TestCase):
self.assertFalse(False)
self.assertRaises(AssertionError, self.assertFalse, True)
- def test_assert_contains(self):
+ def test_assert_in(self):
self.assertIn("abc", "hello abc")
self.assertIn("abc", ["xyz", "abc", "foo"])
self.assertIn("abc", {'abc': 1, 'xyz': 2})
@@ -102,6 +102,14 @@ class TestingTest(TestCase):
self.assertRaises(AssertionError, self.assertIn, "abc", ["x", "xabc"])
self.assertRaises(AssertionError, self.assertIn, "abc", {'x':'abc'})
+ def test_assert_not_in(self):
+ self.assertRaises(AssertionError, self.assertNotIn, "abc", "hello abc")
+ self.assertRaises(AssertionError, self.assertNotIn, "abc", ["xyz", "abc", "foo"])
+ self.assertRaises(AssertionError, self.assertNotIn, "abc", {'abc': 1, 'xyz': 2})
+ self.assertNotIn("abc", "xyz")
+ self.assertNotIn("abc", ["x", "xabc"])
+ self.assertNotIn("abc", {'x':'abc'})
+
class CoverageTestTest(CoverageTest):
"""Test the methods in `CoverageTest`."""