[Numpy-discussion] Monkeypatching vs nose plugin?

Alan McIntyre alan.mcintyre@gmail....
Wed Jul 16 22:21:00 CDT 2008

On Wed, Jul 16, 2008 at 10:00 PM, Robert Kern <robert.kern@gmail.com> wrote:
> Is there a way to do it programatically without requiring numpy to be
> installed with setuptools?

There is; you have to pass a list of plugin instances to the
constructor of TestProgram--all plugins that you might want to use,
even the builtin ones.  (As far as I know, that is.)

The monkeypatching approach was the first one that I could make to
work with the least amount of hassle, but it's definitely not the best
way.  I only had to monkeypatch a couple of things at first, but as I
figured out what the test framework needed to do, it just got worse,
so I was beginning to get uncomfortable with it myself. (Honest! :)
Once the NumPy and SciPy test suites are mostly fixed up to work under
the current rules, I'll go back and use a method that doesn't require
monkeypatching.  It shouldn't have any effect on the public interface
or the tests themselves.

Since we're discussing this sort of thing, there's something I've been
meaning to ask anyway: do we really need to allow end users to pass in
arbitrary extra arguments to nose (via the extra_argv in test())?
This seems to lock us in to having a mostly unobstructed path from
test() through to an uncustomized nose backend.

More information about the Numpy-discussion mailing list