summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2012-05-15 00:28:28 +0200
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2012-05-15 00:28:28 +0200
commitafedbb4f3d970e554195494bee1cae3218b1a607 (patch)
tree5ca479004fe5b2d6eb23ccc4a0b7933622fdf111
parent000d85887ebc649e78a6142b145a712619f4c4a4 (diff)
downloadsemantic-version-afedbb4f3d970e554195494bee1cae3218b1a607.tar.gz
Use unittest2 loader.discover for python2.6
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
-rw-r--r--.travis.yml1
-rwxr-xr-xsetup.py6
2 files changed, 6 insertions, 1 deletions
diff --git a/.travis.yml b/.travis.yml
index 5873a42..eb98332 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,6 +3,7 @@ python:
- "2.6"
- "2.7"
script: "python setup.py test"
+install: "if [[ $TRAVIS_PYTHON_VERSION = 2.6 ]]; then pip install unittest2 --use-mirrors; fi"
notifications:
email: false
irc: "irc.freenode.org#xelnext"
diff --git a/setup.py b/setup.py
index b2fc16d..002cd44 100755
--- a/setup.py
+++ b/setup.py
@@ -41,7 +41,11 @@ class test(cmd.Command):
def run(self):
"""Run the test suite."""
- import unittest
+ try:
+ import unittest2 as unittest
+ except ImportError:
+ import unittest
+
if self.verbose:
verbosity=1
else: