Package logilab :: Package common :: Module testlib
[frames] | no frames]

Module testlib

source code

Run tests.

This will find all modules whose name match a given prefix in the test
directory, and run them. Various command line options provide
additional facilities.

Command line options:

 -v: verbose -- run tests in verbose mode with output to stdout
 -q: quiet   -- don't print anything except if a test fails
 -t: testdir -- directory where the tests will be found
 -x: exclude -- add a test to exclude
 -p: profile -- profiled execution
 -c: capture -- capture standard out/err during tests
 -d: dbc     -- enable design-by-contract
 -m: match   -- only run test matching the tag pattern which follow

If no non-option arguments are present, prefixes used are 'test',
'regrtest', 'smoketest' and 'unittest'.

:copyright: 2003-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
:license: General Public License version 2 - http://www.gnu.org/licenses

Functions
 
find_tests(testdir, prefixes=('test', 'regrtest', 'smoketest', 'unittest', 'func', 'validat..., suffix='.py', excludes=(), remove_suffix=True)
Return a list of all applicable test modules.
source code
 
run_test(test, verbose, runner=None, capture=0)
Run a single test.
source code
 
unittest_main(module='__main__', defaultTest=None, batchmode=False, cvg=None, options=None, outstream=<epydoc.docintrospecter._DevNull instance at 0x4051d1cc>)
use this function if you want to have the same functionality...
source code
Function Details

run_test(test, verbose, runner=None, capture=0)

source code 

Run a single test.

test -- the name of the test
verbose -- if true, print more messages

unittest_main(module='__main__', defaultTest=None, batchmode=False, cvg=None, options=None, outstream=<epydoc.docintrospecter._DevNull instance at 0x4051d1cc>)

source code 
use this function if you want to have the same functionality
as unittest.main