testlib¶
Module: testlib
¶
Utilities to facilitate the writing of tests for nitime.
Functions¶
-
nitime.testlib.
fpw_opt_str
()¶ Return first-package-wins option string for this version of nose
Versions of nose prior to 1.1.0 needed
=True
forfirst-package-wins
, versions after won’t accept it.changeset: 816:c344a4552d76 http://code.google.com/p/python-nose/issues/detail?id=293
Returns: fpw_str : str
Either ‘–first-package-wins’ or ‘–first-package-wins=True’ depending :
on the nose version we are running. :
-
nitime.testlib.
import_nose
()¶ Import nose only when needed.
-
nitime.testlib.
test
(nose_arg='nitime', doctests=True, first_package_wins=True, extra_argv=None)¶ Run the nitime test suite using nose.
Parameters: nose_arg: string, optional :
What the first nose argument should be. Defaults to ‘nitime’, which will run all of the tests that can be found for the package, but this argument allows you to test a subset of the test suite, such as ‘nitime.tests.test_timeseries’ or even a specific test using ‘nitime.tests.test_timeseries:test_TimeArray_comparison’.
doctests: bool, optional :
Whether to run the doctests. Defaults to True
first_package_wins: bool, optional :
Don’t evict packages from sys.module, if detecting another package with the same name in some other location(nosetests default behavior is to do that).
extra_argv: string, list or tuple, optional :
Additional argument (string) or arguments (list or tuple of strings) to be passed to nose when running the tests.