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.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test_testing.py b/test/test_testing.py
index 316dbc1b..c632f3b5 100644
--- a/test/test_testing.py
+++ b/test/test_testing.py
@@ -92,6 +92,14 @@ class TestingTest(TestCase):
self.assertFalse(False)
self.assertRaises(AssertionError, self.assertFalse, True)
+ def test_assert_contains(self):
+ self.assertIn("abc", "hello abc")
+ self.assertIn("abc", ["xyz", "abc", "foo"])
+ self.assertIn("abc", {'abc': 1, 'xyz': 2})
+ self.assertRaises(AssertionError, self.assertIn, "abc", "xyz")
+ self.assertRaises(AssertionError, self.assertIn, "abc", ["x", "xabc"])
+ self.assertRaises(AssertionError, self.assertIn, "abc", {'x':'abc'})
+
class CoverageTestTest(CoverageTest):
"""Test the methods in `CoverageTest`."""