[Numpy-discussion] Monkeypatching vs nose plugin?
Robert Kern
robert.kern at gmail.com
Wed Jul 16 23:32:14 EDT 2008
On Wed, Jul 16, 2008 at 22:21, Alan McIntyre <alan.mcintyre at gmail.com> wrote:
> On Wed, Jul 16, 2008 at 10:00 PM, Robert Kern <robert.kern at 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.
Sounds good.
> 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.
At least with other projects, I occasionally want to do things like
run with --pdb-failure or --detailed-errors, etc. What exactly is
extra_argv blocking? My preference, actually, is for the nosetests
command to be able to run our tests correctly if at all possible.
--
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 NumPy-Discussion
mailing list