diff options
author | Ralf Gommers <ralf.gommers@googlemail.com> | 2014-01-18 17:08:20 +0100 |
---|---|---|
committer | Ralf Gommers <ralf.gommers@googlemail.com> | 2014-01-18 17:08:20 +0100 |
commit | 9dabdb872ccfdc23669e53b22e6dac7c0b6eb462 (patch) | |
tree | 5dfb359d92d53fd6831e5e0cba73828f2851e6b1 /numpy/testing/nosetester.py | |
parent | 3dfc6d654280e47917752d0694f7a1a781335b6e (diff) | |
download | numpy-9dabdb872ccfdc23669e53b22e6dac7c0b6eb462.tar.gz |
BUG: testing.run_module_suite() didn't pass on KnownFailure.
This results in errors whenever you run tests using KnownFailure
like so: ``python test_mymodule.py`` (where run_module_suite is
used in the file, like numpy and scipy do).
Diffstat (limited to 'numpy/testing/nosetester.py')
-rw-r--r-- | numpy/testing/nosetester.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/numpy/testing/nosetester.py b/numpy/testing/nosetester.py index d958be190..21f3feb6f 100644 --- a/numpy/testing/nosetester.py +++ b/numpy/testing/nosetester.py @@ -79,17 +79,17 @@ def run_module_suite(file_to_run=None, argv=None): """ Run a test module. - Equivalent to calling ``$ nosetests <argv> <file_to_run>`` from + Equivalent to calling ``$ nosetests <argv> <file_to_run>`` from the command line Parameters ---------- file_to_run: str, optional - Path to test module, or None. + Path to test module, or None. By default, run the module from which this function is called. argv: list of strings - Arguments to be passed to the nose test runner. ``argv[0]`` is - ignored. All command line arguments accepted by ``nosetests`` + Arguments to be passed to the nose test runner. ``argv[0]`` is + ignored. All command line arguments accepted by ``nosetests`` will work. .. versionadded:: 1.9.0 @@ -101,7 +101,7 @@ def run_module_suite(file_to_run=None, argv=None): if __name__ == "__main__" : run_module_suite(argv=sys.argv) - at the end of a test module will run the tests when that module is + at the end of a test module will run the tests when that module is called in the python interpreter. Alternatively, calling:: @@ -120,7 +120,10 @@ def run_module_suite(file_to_run=None, argv=None): argv = ['', file_to_run] else: argv = argv + [file_to_run] - import_nose().run(argv=argv) + + nose = import_nose() + from .noseclasses import KnownFailure + nose.run(argv=argv, addplugins=[KnownFailure()]) class NoseTester(object): |