Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ENH Add support for tox

  • Loading branch information...
commit a5772a79cdd3cf90da6ec13ca47dcbf8b290f31e 1 parent 83d19b5
@kwgoodman authored
View
1  .gitignore
@@ -4,3 +4,4 @@ build
dist
MANIFEST
*.so
+.tox
View
4 RELEASE.rst
@@ -11,6 +11,10 @@ Bottleneck 0.7.0
*Release date: Not yet released, in development*
+**Enhancements**
+
+- Can now test bottleneck on multiple python versions using tox
+
**Bug fixes**
- #50 move_std, move_nanstd return inappropriate NaNs (sqrt of negative #)
View
51 tools/test-installed-bottleneck.py
@@ -0,0 +1,51 @@
+#!/usr/bin/env python
+from __future__ import division
+
+# This file is a modified version of the original numpy file:
+# test-installed-numpy.py
+
+# A simple script to test the installed version of bottleneck by calling
+# 'numpy.test()'. Key features:
+# -- convenient command-line syntax
+# -- sets exit status appropriately, useful for automated test environments
+
+# It would be better to set this up as a module in the bottleneck namespace, so
+# that it could be run as:
+# python -m numpy.run_tests <args>
+# But, python2.4's -m switch only works with top-level modules, not modules
+# that are inside packages. So, once we drop 2.4 support, maybe...
+# TODO: Bottleneck doesn't support python 2.4
+
+import sys
+# In case we are run from the source directory, we don't want to import
+# bottleneck from there, we want to import the installed version:
+sys.path.pop(0)
+
+from optparse import OptionParser
+parser = OptionParser("usage: %prog [options] -- [nosetests options]")
+parser.add_option("-v", "--verbose",
+ action="count", dest="verbose", default=1,
+ help="increase verbosity")
+parser.add_option("--doctests",
+ action="store_true", dest="doctests", default=False,
+ help="Run doctests in module")
+parser.add_option("--coverage",
+ action="store_true", dest="coverage", default=False,
+ help="report coverage of NumPy code (requires 'coverage' module")
+parser.add_option("-m", "--mode",
+ action="store", dest="mode", default="fast",
+ help="'fast', 'full', or something that could be "
+ "passed to nosetests -A [default: %default]")
+(options, args) = parser.parse_args()
+
+import bottleneck
+result = bottleneck.test(options.mode,
+ verbose=options.verbose,
+ extra_argv=args,
+ doctests=options.doctests,
+ coverage=options.coverage)
+
+if result.wasSuccessful():
+ sys.exit(0)
+else:
+ sys.exit(1)
View
12 tox.ini
@@ -0,0 +1,12 @@
+# Tox (http://tox.testrun.org/) configuration
+
+[tox]
+envlist = py27, py32
+
+[testenv]
+deps =
+ nose
+ numpy >= 1.6.1
+
+changedir={envdir}
+commands=python {toxinidir}/tools/test-installed-bottleneck.py {posargs:}
Please sign in to comment.
Something went wrong with that request. Please try again.