[SciPy-dev] mimicking output of scipy.test() in other packages that use numpy.testing
Robert Kern
robert.kern at gmail.com
Thu Mar 5 16:37:26 EST 2009
On Thu, Mar 5, 2009 at 15:28, Stéfan van der Walt <stefan at sun.ac.za> wrote:
> 2009/3/5 Robert Kern <robert.kern at gmail.com>:
>> It's hardcoded in nosetester.py:
>>
>> def _show_system_info(self):
>> nose = import_nose()
>>
>> import numpy
>> print "NumPy version %s" % numpy.__version__
>> npdir = os.path.dirname(numpy.__file__)
>> print "NumPy is installed in %s" % npdir
>>
>> if 'scipy' in self.package_name:
>> import scipy
>> print "SciPy version %s" % scipy.__version__
>> spdir = os.path.dirname(scipy.__file__)
>> print "SciPy is installed in %s" % spdir
>
> Having nosetester.py specially adapted for SciPy is not ideal. Can't
> we rather provide a hook into nosetester, and have NumPy and SciPy
> call it upon import?
I wouldn't call that ideal, either.
I would probably have test() functions in numpy.__init__ and
scipy.__init__ which would internally import the Tester, print out
these messages, then run Tester().test(*args, **kwds). I don't see a
real need for this information to be in the Tester class itself, just
the convenience {numpy,scipy}.test() functions.
--
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