Regression testing framework Author: Ernesto Posse
This script runs a collection of unit tests in a given directory tree. It’s purpose is to easily perform regression testing.
It collects all test cases (subclasses of unittest.TestCase) found in the directory tree in every python file whose name satisfies a given pattern, and only in directories which satisfy the given pattern under the given base directory.
Usage: runtests [options] [base_dir]
- Options:
-h, --help show this help message and exit -f FILE_NAME_PATTERN, --files=FILE_NAME_PATTERN Specify the files to include by name pattern (a regular expression). The default is ‘test[0-9]*.py$’ -d DIR_NAME_PATTERN, --dirs=DIR_NAME_PATTERN Specify the directories to include by name pattern (a regular expression). The default is ‘.+$’ -p ADDITIONAL_PATHS, --path=ADDITIONAL_PATHS Specify additional paths to include in the PYTHONPATH. The default is ‘.’ -v VERBOSITY, --verbosity=VERBOSITY Specify the verbosity of the test run. The default is ‘2’
Returns the result of parsing the command-line options.
Returns the list of qualified module names for modules that meet the criteria that: 1) are defined inside a package within the base_dir directory 2) their file name matches the given pattern 3) their containing directory is a package that matches the given pattern.