[SciPy-dev] Doctest execution context

Robert Kern robert.kern@gmail....
Wed Jul 16 02:38:10 CDT 2008


On Wed, Jul 16, 2008 at 02:22, Alan McIntyre <alan.mcintyre@gmail.com> wrote:
> Hi all,
>
> Currently, the NumPy doctests, when executed via
> numpy.test(doctests=True), are run in a context that's pretty much
> equivalent to a fresh Python interpreter that's executed "import numpy
> as np".  Should we do something similar for SciPy? For example, if the
> NoseTester figures out that it's running tests for SciPy or one of its
> packages, we could add "import scipy as sp" (or something similar) to
> the context.

Tricky. "import scipy" doesn't import the subpackages, so that's
pretty useless. Can you customize it per docstring? I.e. for the
docstring of scipy.linalg.qr(), have a "from scipy.linalg import qr"
or "from scipy import linalg" in the context?

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
 -- Umberto Eco


More information about the Scipy-dev mailing list