Module t.t.runner

Part of twisted.trial View Source

A miscellany of code used to run Trial tests.

Maintainer: Jonathan Lange <jml@twistedmatrix.com>
Function isPackage Given an object return True if the object looks like a package
Function isPackageDirectory Is the directory at path 'dirname' a Python package directory?
Function samefile A hacky implementation of os.path.samefile. Used by filenameToModule
Function filenameToModule Given a filename, do whatever possible to return a module object matching
Function _importFromFile Undocumented
Function _resolveDirectory Undocumented
Function suiteVisit Visit each test in suite with visitor.
Class TestSuite Extend the standard library's TestSuite with support for the visitor
Class LoggedSuite Any errors logged in this suite will be reported to the TestResult
Class DocTestSuite Behaves like doctest.DocTestSuite, but decorates individual TestCases so
Class PyUnitTestCase This class decorates the pyunit.TestCase class, mainly to work around the
Class DocTestCase No class docstring; 1/1 methods documented
Class TrialSuite Suite to wrap around every single test in a trial run. Used internally
Function name
Function isTestCase Returns True if obj is a class that contains test cases, False
Class TestHolder Placeholder for a TestCase inside a reporter. As far as a TestResult
Class ErrorHolder Used to insert arbitrary errors into a test suite run. Provides enough
Class TestLoader I find tests inside function, modules, files -- whatever -- then return
Class DryRunVisitor A visitor that makes a reporter think that every test visited has run
Class TrialRunner A specialised runner that the trial front end uses.
def isPackage(module): (source)
Given an object return True if the object looks like a package
def isPackageDirectory(dirname): (source)
Is the directory at path 'dirname' a Python package directory? Returns the name of the __init__ file (it may have a weird extension) if dirname is a package directory. Otherwise, returns False
def samefile(filename1, filename2): (source)
A hacky implementation of os.path.samefile. Used by filenameToModule when the platform doesn't provide os.path.samefile. Do not use this.
def filenameToModule(fn): (source)

Given a filename, do whatever possible to return a module object matching that file.

If the file in question is a module in Python path, properly import and return that module. Otherwise, load the source manually.
ParametersfnA filename.
ReturnsA module object.
RaisesValueErrorIf fn does not exist.
def _importFromFile(fn, moduleName=None): (source)
Undocumented
def _resolveDirectory(fn): (source)
Undocumented
def suiteVisit(suite, visitor): (source)
Visit each test in suite with visitor.
ParametersvisitorA callable which takes a single argument, the TestCase instance to visit.
ReturnsNone
def name(thing): (source)
Parametersthingan object from modules (instance of PythonModule, PythonAttribute), a TestCase subclass, or an instance of a TestCase.
def isTestCase(obj): (source)
Returns True if obj is a class that contains test cases, False otherwise. Used to find all the tests in a module.
API Documentation for twisted, generated by pydoctor.