Trees | Indices | Help |
|
---|
|
Class to run a particular unit test or a directory of unit tests.
|
|||
|
|||
str |
|
||
str |
|
||
str |
|
||
Inherited from |
|
|||
list of str |
system_path_pattern =
A search template for the directory in which relax is installed. |
||
list of str |
unit_test_path_pattern =
A search template for the directory from which all unit module directories descend. |
||
list of str |
test_case_patterns =
A list of regex patterns against which files will be tested to see if they are expected to contain unit tests. |
|
|||
Inherited from |
|
Initialise the unit test runner.
|
Get the minimal path searching up the file system to target_directory. The algorithm is that we repeatedly chop the end off path and see if the tail of the path matches target_path If it doesn't match we search in the resulting directory by appending target_path and seeing if it exists in the file system. Finally once the required directory structure has been found the offset_path is appended to the found path and the resulting path normalised. Note the algorithm understands .. and .
|
Determine the possible paths of the test_module. It is assumed that the test_module can be either a path or a python module or package name including dots. The following heuristics are used:
Note: we can't deal with module methods...
|
Run a unit test or set of unit tests.
|
|
system_path_patternA search template for the directory in which relax is installed. The directory which relax is installed in is viewed as the the 'PYTHONPATH' of the classes to be tested. It must be unique and defined relative to the test suite. For the current setup in relax this is ('test_suite', /'..'). The first string is a directory structure to match the second string is a relative path from that directory to the system directory. The search is started from the value of root_path in the file system.
|
unit_test_path_patternA search template for the directory from which all unit module directories descend. For the current setup in relax this is ('unit_tests', '.'). The search is started from the value of root_path in the file system.
|
test_case_patternsA list of regex patterns against which files will be tested to see if they are expected to contain unit tests. If the file has the correct pattern the module contained inside the file will be searched for testCases e.g in the case of test_float.py the module to be searched for would be test_float.Test_float.
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Apr 10 13:32:23 2013 | http://epydoc.sourceforge.net |