diff --git a/pathspec/tests/test_gitignore.py b/pathspec/tests/test_gitignore.py index 91b8309..c4ff5af 100644 --- a/pathspec/tests/test_gitignore.py +++ b/pathspec/tests/test_gitignore.py @@ -2,8 +2,10 @@ """ This script tests ``GitIgnorePattern``. """ - -import unittest +try: + import unittest2 as unittest # for Python 2.6 +except ImportError: + import unittest from pathspec import GitIgnorePattern diff --git a/setup.py b/setup.py index 2debb3a..4e37dc7 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,7 @@ # coding: utf-8 import io +import sys from setuptools import setup, find_packages from pathspec import __author__, __email__, __license__, __project__, __version__ @@ -34,4 +35,5 @@ license=__license__, packages=find_packages(), test_suite='pathspec.tests.test_gitignore.GitIgnoreTest', + tests_require=['unittest2'] if sys.version_info < (2, 7) else [], ) diff --git a/tox.ini b/tox.ini index 3132be9..565a9eb 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,9 @@ [tox] -envlist = py27, py33, py34, pypy +envlist = py26, py27, py33, py34, pypy + +[testenv:py26] +deps = unittest2 +commands = python setup.py test [testenv] commands = python setup.py test