diff --git a/setup.py b/setup.py index dd2e0a9..0b50fcc 100755 --- a/setup.py +++ b/setup.py @@ -1,8 +1,13 @@ #!/usr/bin/env python - + +import sys from setuptools import setup from ts3 import __version__ - + +test_require = ['mock'] +if sys.version < '2.7': + test_require.append('unittest2') + setup( name="python-ts3", version=__version__, @@ -14,7 +19,7 @@ setup( packages=['ts3'], scripts=['examples/gents3privkey.py'], test_suite='ts3.test.suite', - + test_require=test_require, classifiers=[ 'License :: OSI Approved :: BSD License', 'Topic :: Internet', diff --git a/ts3/test.py b/ts3/test.py index bcf8fdd..50bfa21 100644 --- a/ts3/test.py +++ b/ts3/test.py @@ -1,4 +1,8 @@ -import unittest + +try: + import unittest2 as unittest +except ImportError: + import unittest import socket import threading import time