In order to support a portable and non-restrictive idenitification mechanism, PyInq makes use of Python decorators (which it refers to as tags).
In order to identify a function as a test in PyInq, the function must be wrapped with a test decorator. Similarly, classes containing tests must be wrapped with a testClass decorator.
A tag may accept arguments to modify the function’s operation, such as its inclusion in a test suite. Other tags identify test fixtures, or cause the test to be skipped (either conditionally or unconditionally).
Registers the function/method that follows as a test. When the containing module is run, this test is executed and its result is reported.
All arguments must be passed as keyword arguments.
expected signifies that the test must raise the specified error in order to pass. Note that any expression in the test may raise the desired exception. For more fine grain control over expected exceptions, see assert_raises().
suite should be a string indicating which suite to put this test in, which can be run from the command line (see Running PyInq).
Registers the class as containing tests. This allows the entire class to be skipped or added to a suite. Behavior of registered tests in an unregistered class is undefined.
All arguments must be passed as keyword arguments.
suite should be a string. All methods in the class will be added to the named suite, which can be run from the command line (see Running PyInq). Note that this includes methods listed to be included in a different suite. In this case, the test will appear in both suites.
Note that any fixtures defined outside a class treat all module scope tests as belonging to a single class.
The order of execution is:
Run before and after the named suite. If no suite is provided, it is run only when no specific suite is run, effectively treating all detected tests as part of the same suite. This function should be defined in the module scope.
Run before and after the containing module; that is, all tests in the module. This function should be defined in the module scope.