Package test_suite :: Package unit_tests :: Module unit_test_runner :: Class Test_finder
[hide private]
[frames] | no frames]

Class Test_finder

source code

Find and load unit test classes as a hierarchy of TestSuites and TestCases.

The class provides functions for running or returning the resulting TestSuite and requires a root directory to start searching from.

TestCases are identified by the class name matching a pattern (pattern_string).

Instance Methods [hide private]
 
__init__(self, root_path=None, pattern_list=[])
Initialise the unit test finder.
source code
 
scan_paths(self)
Scan directories and paths for unit test classes and load them into TestSuites.
source code
Class Variables [hide private]
  suite = <unittest.suite.TestSuite tests=[]>
The root test suite to which testSuites and cases are added.
Method Details [hide private]

__init__(self, root_path=None, pattern_list=[])
(Constructor)

source code 

Initialise the unit test finder.

Parameters:
  • root_path (str) - The path to starts searching for unit tests from, all sub directories and files are searched.
  • pattern_list (list of str) - A list of regular expression patterns which identify a file as one containing a unit test TestCase.