TestablePackage
encapsulates a package that can be extracted and tested.
The TestablePackage class is accessible via the testtools.bgtests module.
Attributes
Methods
f get_name(self) ...
get the name of this package.
looks for self.__name__ or else uses the class name of self.
f skip_notify(self, buffer) ...
when True, notification is skipped.
it's only called on error. buffer is the output of the failing test(s)
f recognizes_file(self, filepath, code=None) ...
should return True if filepath from repos affects this package.
filepath is grabbed from the output of svnlook. it starts with the first dir relative to the repository root and will not contain a forward slash.
f runtests(self, rev=None, stream=<open file '<stdout>', mode 'w' at 0x12068>, notify=None, header='', tmp_dir=None) ...
runs tests for this package.
returns True if tests passed, false otherwise.
Keyword Arguments:
- rev -- optional revision to export (head otherwise)
- stream -- filelike object for reporter, defaults to sys.stdout
- notify -- if not empty, results are emailed here
- header -- string to prepend onto test suite output
- tmp_dir -- directory to export into and run tests (i.e. /tmp, the default)
See the source for more information.