unittest.TestLoader()
unittest.TestLoader() is a Python function in the Unittest Module category. Loads test cases from modules and classes. The syntax is unittest.TestLoader(). Returns: TestLoader object. A typical example: loader = unittest.TestLoader()
suite = loader.loadTestsFromModule(test_module)
runner = unittest.TextTestRunner()
runner.run(suite). 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.assertIn(). This page is part of the free Python Reference documentation covering 978+ functions, methods, and modules with examples and parameter details. You can try unittest.TestLoader() immediately in the Python playground, look up unfamiliar terms in the glossary, or return to the Python Reference homepage.