diff --git a/.travis.yml b/.travis.yml index 6e717c33..ac1f0ce8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,5 +3,5 @@ python: - "2.7" - "2.6" - "2.5" -install: if [ "$(python --version 2>&1)" == "Python 2.5.6" ]; then pip install -r python25-requirements.txt --use-mirrors; fi +install: if [ "$(python --version 2>&1)" == "Python 2.5.6" ]; then pip install -r python25-requirements.txt --use-mirrors; fi; if [ "$(python --version 2>&1)" == "Python 2.6.8" ]; then pip install -r python26-requirements.txt --use-mirrors; fi script: python ./setup.py test diff --git a/github/tests/__init__.py b/github/tests/__init__.py index ba9e1b20..3f15457c 100644 --- a/github/tests/__init__.py +++ b/github/tests/__init__.py @@ -11,10 +11,20 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import unittest +import sys + +atLeastPython27 = sys.hexversion >= 0x02070000 + +if atLeastPython27: + import unittest +else: # pragma no cover + import unittest2 as unittest # pragma no cover import AllTests def run(): - return unittest.main(module=AllTests, argv=["Dummy Script Name"], exit=False).result + testLoader = unittest.loader.TestLoader() + testRunner = unittest.runner.TextTestRunner(verbosity=1) + test = testLoader.loadTestsFromModule(AllTests) + return testRunner.run(test) diff --git a/python25-requirements.txt b/python25-requirements.txt index 7693e645..609f9122 100644 --- a/python25-requirements.txt +++ b/python25-requirements.txt @@ -1 +1,2 @@ simplejson +unittest2 diff --git a/python26-requirements.txt b/python26-requirements.txt new file mode 100644 index 00000000..9a23970d --- /dev/null +++ b/python26-requirements.txt @@ -0,0 +1 @@ +unittest2