diff options
author | Alan McIntyre <alan.mcintyre@local> | 2008-08-26 18:41:53 +0000 |
---|---|---|
committer | Alan McIntyre <alan.mcintyre@local> | 2008-08-26 18:41:53 +0000 |
commit | 21a1087691af6c1745f4b4bc56b4072b5a68bccd (patch) | |
tree | 2dce4c8ca08c1761d69c3683acc1f24bad9cb4bc /numpy/testing/nosetester.py | |
parent | 971f9fa1216bde41f4b4a3cb40eb1024c7a06433 (diff) | |
download | numpy-21a1087691af6c1745f4b4bc56b4072b5a68bccd.tar.gz |
Added benchmarks directory to lib/setup.py so that numpy.lib benchmarks are
available in an installed NumPy.
Display system configuration information when benchmarks are run.
Diffstat (limited to 'numpy/testing/nosetester.py')
-rw-r--r-- | numpy/testing/nosetester.py | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/numpy/testing/nosetester.py b/numpy/testing/nosetester.py index ed46681e1..ee682967c 100644 --- a/numpy/testing/nosetester.py +++ b/numpy/testing/nosetester.py @@ -144,6 +144,24 @@ class NoseTester(object): argv += extra_argv return argv + 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__ + def test(self, label='fast', verbose=1, extra_argv=None, doctests=False, coverage=False, **kwargs): @@ -216,22 +234,9 @@ class NoseTester(object): argv += ['--exclude','swig_ext'] argv += ['--exclude','array_from_pyobj'] - nose = import_nose() - - import numpy - print "NumPy version %s" % numpy.__version__ - npdir = os.path.dirname(numpy.__file__) - print "NumPy is installed in %s" % npdir + self._show_system_info() - 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__ + nose = import_nose() # Because nose currently discards the test result object, but we need # to return it to the user, override TestProgram.runTests to retain @@ -274,6 +279,10 @@ class NoseTester(object): ''' Run benchmarks for module using nose %(test_header)s''' + + print "Running benchmarks for %s" % self.package_name + self._show_system_info() + nose = import_nose() argv = self._test_argv(label, verbose, extra_argv) argv += ['--match', r'(?:^|[\\b_\\.%s-])[Bb]ench' % os.sep] |