A test loader finds tests from the functions, modules, and files that is asked to and loads them into a TestSuite or TestCase.

See TestLoader for further details.

Method loadFile Load a file, and then the tests in that file.
Method findByName Find and load tests, given name.
Method loadAnything Load absolutely anything (as long as that anything is a module, package, class, or method (with associated parent class and qualname).
Method loadByName Load some tests by name.
Method loadByNames Load some tests by a list of names.
Method loadClass Given a class which contains test cases, return a list of TestCases.
Method loadMethod Given a method of a TestCase that represents a test, return a TestCase instance for that test.
Method _uniqueTests No summary

Inherited from TestLoader:

Instance Variable methodPrefix A string prefix. TestLoader will assume that all the methods in a class that begin with methodPrefix are test cases.
Instance Variable modulePrefix A string prefix. Every module in a package that begins with modulePrefix is considered a module full of tests.
Instance Variable forceGarbageCollection A flag applied to each TestCase loaded. See unittest.TestCase for more information.
Instance Variable sorter A key function used to sort TestCases, test classes, modules and packages.
Instance Variable suiteFactory A callable which is passed a list of tests (which themselves may be suites of tests). Must return a test suite.
Method __init__ Undocumented
Method sort Sort the given things using sorter.
Method findTestClasses Given a module, return all Trial test classes
Method loadModule Return a test suite with all the tests from a module.
Method getTestCaseNames Given a class that contains TestCases, return a list of names of methods that probably contain tests.
Method loadPackage Load tests from a module object representing a package, and return a TestSuite containing those tests.
Method loadDoctests Return a suite of tests for all the doctests defined in module.
Method _makeCase Undocumented
def loadFile(self, fileName, recurse=False): (source)

Load a file, and then the tests in that file.

ParametersfileNameThe file name to load.
recurseA boolean. If True, inspect modules within packages within the given package (and so on), otherwise, only inspect modules in the package itself.
def findByName(self, _name, recurse=False): (source)

Find and load tests, given name.

This partially duplicates the logic in unittest.loader.TestLoader.

ParametersnameThe qualified name of the thing to load.
recurseA boolean. If True, inspect modules within packages within the given package (and so on), otherwise, only inspect modules in the package itself.
def loadAnything(self, obj, recurse=False, parent=None, qualName=None): (source)

Load absolutely anything (as long as that anything is a module, package, class, or method (with associated parent class and qualname).

ParametersobjThe object to load.
recurseA boolean. If True, inspect modules within packages within the given package (and so on), otherwise, only inspect modules in the package itself.
parentIf obj is a method, this is the parent class of the method. qualName is also required.
qualNameIf obj is a method, this a list containing is the qualified name of the method. parent is also required.
def loadByName(self, name, recurse=False): (source)

Load some tests by name.

ParametersnameThe qualified name for the test to load.
recurseA boolean. If True, inspect modules within packages within the given package (and so on), otherwise, only inspect modules in the package itself.
def loadByNames(self, names, recurse=False): (source)

Load some tests by a list of names.

ParametersnamesA list of qualified names.
recurseA boolean. If True, inspect modules within packages within the given package (and so on), otherwise, only inspect modules in the package itself.
def loadClass(self, klass): (source)

Given a class which contains test cases, return a list of TestCases.

ParametersklassThe class to load tests from.
def loadMethod(self, method): (source)

Given a method of a TestCase that represents a test, return a TestCase instance for that test.

def _uniqueTests(self, things): (source)

Gather unique suite objects from loaded things. This will guarantee uniqueness of inherited methods on TestCases which would otherwise hash to same value and collapse to one test unexpectedly if using simpler means: e.g. set().

API Documentation for Twisted, generated by pydoctor at 2016-10-29 16:19:29.