unittest.TestLoader

class unittest.TestLoader[source]

This class is responsible for loading tests according to various criteria and returning them wrapped in a TestSuite

Methods

__format__ default object formatter
__new__((S, ...)
__reduce__ helper for pickle
__reduce_ex__ helper for pickle
__sizeof__(() -> int) size of object in memory, in bytes
__subclasshook__ Abstract classes can override this to customize issubclass().
_find_tests(start_dir, pattern) Used by discovery.
_get_directory_containing_module(module_name)
_get_module_from_name(name)
_get_name_from_path(path)
_match_path(path, full_path, pattern)
discover(start_dir[, pattern, top_level_dir]) Find and return all test modules from the specified start directory, recursing into subdirectories to find them.
getTestCaseNames(testCaseClass) Return a sorted sequence of method names found within testCaseClass
loadTestsFromModule(module[, use_load_tests]) Return a suite of all tests cases contained in the given module
loadTestsFromName(name[, module]) Return a suite of all tests cases given a string specifier.
loadTestsFromNames(names[, module]) Return a suite of all tests cases found using the given sequence of string specifiers.
loadTestsFromTestCase(testCaseClass) Return a suite of all tests cases contained in testCaseClass
sortTestMethodsUsing cmp(x, y) -> integer

Attributes

testMethodPrefix