[SciPy-dev] mimicking output of scipy.test() in other packages that use numpy.testing

Robert Kern robert.kern at gmail.com
Wed Mar 4 21:24:01 EST 2009


On Wed, Mar 4, 2009 at 20:19, Nathan Bell <wnbell at gmail.com> wrote:
> PyAMG uses numpy.testing for unittesting support.  How do I make
> pyamg.test() output the SciPy and PyAMG version info as scipy.test()
> does below?  I browsed through the numpy and scipy source trees and
> it's still unclear to me where this information is provided to test().

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

        pyversion = sys.version.replace('\n','')
        print "Python version %s" % pyversion
        print "nose version %d.%d.%d" % nose.__versioninfo__

-- 
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