TestCase.assertIn()
TestCase.assertIn() is a Python method in the Unittest Module category. Tests that member is in container. The syntax is TestCase.assertIn(member, container, msg=None). Returns: None. A typical example: self.assertIn("key", result_dict). A close sibling is unittest.TestCase(), which base class for writing unit tests. Provides assertion methods and test runner support. A close sibling is TestCase.assertEqual(), which tests that first == second. Fails with msg if not equal. A close sibling is TestCase.assertTrue(), which tests that expr is True. A close sibling is TestCase.assertFalse(), which tests that expr is False. More about this category: Unit testing framework — TestCase, assertEqual, assertRaises, TestSuite. Related Unittest Module entries: unittest.TestCase(), TestCase.assertEqual(), TestCase.assertTrue(), TestCase.assertFalse(), TestCase.assertRaises(), TestCase.assertIsNone(). This page is part of the free Python Reference documentation covering 978+ functions, methods, and modules with examples and parameter details. You can try TestCase.assertIn() immediately in the Python playground, look up unfamiliar terms in the glossary, or return to the Python Reference homepage.