Package logilab-common-0 :: Package 39 :: Package 0 :: 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=DEFAULT_PREFIXES, 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=sys.stderr)
use this functon if you want to have the same functionality...
source code
Variables
  main = obsolete("testlib.main() is obsolete, use the pytest to...
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=sys.stderr)

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


Variables Details

main

Value:
obsolete("testlib.main() is obsolete, use the pytest tool instead")(ma\
in)