Skip to content

Commit

Permalink
ENH: skip doctests for tests
Browse files Browse the repository at this point in the history
There are various docstrings show examples of how to run the tests, and
give example test output.  Obviously the test output changes, and
running the doctests for the testing package:

import numpy.testing as npt
npt.test(doctests=True)

will cause several large sets of tests to be run in the rest of the
tree.  So I skipped these.
  • Loading branch information
matthew-brett authored and charris committed Aug 16, 2011
1 parent 316d1f4 commit 57747fc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
15 changes: 7 additions & 8 deletions numpy/testing/nosetester.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,24 +287,23 @@ def test(self, label='fast', verbose=1, extra_argv=None, doctests=False,
Notes
-----
Each NumPy module exposes `test` in its namespace to run all tests for it.
For example, to run all tests for numpy.lib::
For example, to run all tests for numpy.lib:
>>> np.lib.test()
>>> np.lib.test() #doctest: +SKIP
Examples
--------
>>> result = np.lib.test()
>>> result = np.lib.test() #doctest: +SKIP
Running unit tests for numpy.lib
...
Ran 976 tests in 3.933s
OK
>>> result.errors
>>> result.errors #doctest: +SKIP
[]
>>> result.knownfail
>>> result.knownfail #doctest: +SKIP
[]
"""

# cap verbosity at 3 because nose becomes *very* verbose beyond that
Expand Down Expand Up @@ -368,7 +367,7 @@ def bench(self, label='fast', verbose=1, extra_argv=None):
Examples
--------
>>> success = np.lib.bench()
>>> success = np.lib.bench() #doctest: +SKIP
Running benchmarks for numpy.lib
...
using 562341 items:
Expand All @@ -381,7 +380,7 @@ def bench(self, label='fast', verbose=1, extra_argv=None):
...
OK
>>> success
>>> success #doctest: +SKIP
True
"""
Expand Down
5 changes: 2 additions & 3 deletions numpy/testing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -954,10 +954,9 @@ def rundocs(filename=None, raise_on_error=True):
-----
The doctests can be run by the user/developer by adding the ``doctests``
argument to the ``test()`` call. For example, to run all tests (including
doctests) for `numpy.lib`::
>>> np.lib.test(doctests=True)
doctests) for `numpy.lib`:
>>> np.lib.test(doctests=True) #doctest: +SKIP
"""
import doctest, imp
if filename is None:
Expand Down

0 comments on commit 57747fc

Please sign in to comment.