[Numpy-svn] [numpy/numpy] b0c1f6: ENH: refactor of docteset plugin management

noreply at github.com noreply at github.com
Tue Aug 16 12:48:16 EDT 2011


  Branch: refs/heads/master
  Home:   https://github.com/numpy/numpy

  Commit: b0c1f6b67ecd5cf865cf6945bff632f81473b81a
      https://github.com/numpy/numpy/commit/b0c1f6b67ecd5cf865cf6945bff632f81473b81a
  Author: Matthew Brett <matthew.brett at gmail.com>
  Date:   2011-08-16 (Tue, 16 Aug 2011)

  Changed paths:
    M numpy/testing/noseclasses.py
  M numpy/testing/nosetester.py

  Log Message:
  -----------
  ENH: refactor of docteset plugin management

We previously had a baroque inheritance scheme to deal with the case
where the user had normal nose doctests enabled in their environment.
However, this scheme didn't deal with bench() routine, and was
complicated. This commit uses a null Unplugger plugin to pull the
doctest plugin off the nose configuration after it has been initialized.
We can use this for bench() and test(), and it allows the doctest module
to be enabled (by the user environment) and then thrown away.

Also rejigged the docstrings and removed the automated docstring
addition as the docstrings have already been copied and adapted in the
code.


  Commit: 8eba1efb4599adfcca6c08d041cfca3111f064db
      https://github.com/numpy/numpy/commit/8eba1efb4599adfcca6c08d041cfca3111f064db
  Author: Matthew Brett <matthew.brett at gmail.com>
  Date:   2011-08-16 (Tue, 16 Aug 2011)

  Changed paths:
    M numpy/testing/nosetester.py

  Log Message:
  -----------
  ENH: refactor testing to improve subclass support

Refactor ``prepare_test_args`` method to make it easier for subclasses
to adapt its behavior.  This should make it easier for nipy and other
projects to use the numpy testing machinery without wholesale copies
into their source trees.


  Commit: 199535c5c34360be7238c80b25d810abce62e6e4
      https://github.com/numpy/numpy/commit/199535c5c34360be7238c80b25d810abce62e6e4
  Author: Matthew Brett <matthew.brett at gmail.com>
  Date:   2011-08-16 (Tue, 16 Aug 2011)

  Changed paths:
    M numpy/testing/nosetester.py
  A numpy/testing/tests/test_doctesting.py

  Log Message:
  -----------
  ENH: move doctest tests to own file with ifmain

The doctesting tests were in the code file, and (for me) rather
difficult to run without running lots of other tests.  With this change
you can run the doctest tests in isolation by executing the
test_doctesting.py file.


  Commit: 316d1f4ec9e033b21062b8f2dcdddeef01d7a889
      https://github.com/numpy/numpy/commit/316d1f4ec9e033b21062b8f2dcdddeef01d7a889
  Author: Matthew Brett <matthew.brett at gmail.com>
  Date:   2011-08-16 (Tue, 16 Aug 2011)

  Changed paths:
    M numpy/testing/noseclasses.py
  M numpy/testing/tests/test_doctesting.py

  Log Message:
  -----------
  FIX: fix doctest error with empty output

The numpy doctest extension generates an error with empty doctest output;
this most often comes about with the +SKIP option.

The numpy doctest plugin exposed a nose bug because it accidentally used
a different default for the 'doctest-result-variable'.

nose bug report here:
http://code.google.com/p/python-nose/issues/detail?id=445


  Commit: 57747fcc8179eacd9a6920e6a2f69dedb08834da
      https://github.com/numpy/numpy/commit/57747fcc8179eacd9a6920e6a2f69dedb08834da
  Author: Matthew Brett <matthew.brett at gmail.com>
  Date:   2011-08-16 (Tue, 16 Aug 2011)

  Changed paths:
    M numpy/testing/nosetester.py
  M numpy/testing/utils.py

  Log Message:
  -----------
  ENH: skip doctests for tests

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.


  Commit: 31aecd9b092d5bab27aac2288758eedbeda7bb81
      https://github.com/numpy/numpy/commit/31aecd9b092d5bab27aac2288758eedbeda7bb81
  Author: Matthew Brett <matthew.brett at gmail.com>
  Date:   2011-08-16 (Tue, 16 Aug 2011)

  Changed paths:
    M numpy/testing/noseclasses.py

  Log Message:
  -----------
  ENH: remove unused class definition

NumpyDocTestCase definition overwritten further down the file.

The deleted class only redefined the ``id`` method with the same code
as that in the parent class since before nose 0.10.


  Commit: 78f7542add429689465c79d2d2f2042c38239672
      https://github.com/numpy/numpy/commit/78f7542add429689465c79d2d2f2042c38239672
  Author: Matthew Brett <matthew.brett at gmail.com>
  Date:   2011-08-16 (Tue, 16 Aug 2011)

  Changed paths:
    M numpy/testing/noseclasses.py

  Log Message:
  -----------
  ENH: refactor doctest plugin to help subclassing

Move numpy-specific parts of the plugin into their own methods, or into
class-level defines.  This makes it easier to subclass the plugin.  This
in turn may help keep more eyes on the code.


Compare: https://github.com/numpy/numpy/compare/5cf0a07...78f7542



More information about the Numpy-svn mailing list