4Suite™ API Documentation

# ► Module Ft.Lib.TestSuite.TestSuite

Provides the TestSuite class, which represents the package(s) to test.
Copyright 2002 Fourthought, Inc. (USA).
Detailed license and copyright information: http://4suite.org/COPYRIGHT
Project home, documentation, distributions: http://4suite.org/

Classes: TestSuite |  |  |  | Fields: StringTypes, USAGE

## Classes

class TestSuite
A command-line program that runs a set of tests; this is primarily for making test modules conveniently executable.

### Methods

__init__(self, attrs)
addTests(self, packages)
generateUsage(self)
parseCommandLine(self)
Parse the test script's command line, taken from the 'script_args' instance attribute (which defaults to 'sys.argv[1:]'). This is first processed for options that set attributes of the TestSuite instance. Then, it is scanned for test arguments.
runTests(self)
showHelp(self, tests)
showTests(self)

### Fields

boolean_opts = ('full', 'stop', 'nocolor', 'noreport', 'offline', 'help', 'help-tests')
negative_opts = {'nocolor': 'color', 'noreport': 'report', 'quiet': 'verbose'}
options = [('help', 'h', 'Show detailed help message'), ('help-tests', 't', 'List all available tests'), ('verbose', 'v', 'Increase display verbosity'), ('quiet', 'q', 'Decrease display verbosity'), ('mode=', 'm', 'Add mode to default modes to run'), ('skip=', 'k', 'Remove a mode from the modes to run'), ('full', 'f', 'Use all modes'), ('stop', 's', 'Stop on errors'), ('nocolor', 'n', 'Disable ANSI color sequences'), ('noreport', 'r', 'Disable report generation'), ('outfile=', 'o', 'Specify an output file for all results'), ('offline', 'l', 'Skip tests requiring internet connection')]

## Fields

StringTypes = (<type 'str'>, <type 'unicode'>)
USAGE = "Usage:\n %(script)s [options] [test] [...]\n %(s...p)sfile run just 'file' from 'directory'\n"