diff --git a/pyamf/tests/__init__.py b/pyamf/tests/__init__.py index 8691fa3d..67a47294 100644 --- a/pyamf/tests/__init__.py +++ b/pyamf/tests/__init__.py @@ -9,12 +9,18 @@ import os.path -import unittest +try: + import unittest2 as unittest + import sys + + sys.modules['unittest'] = unittest +except ImportError: + pass def get_suite(): """ - Return a unittest.TestSuite. + Discover the entire test suite. """ loader = unittest.TestLoader() diff --git a/setup.py b/setup.py index 34fb0188..04e70caf 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,6 @@ import sys, os.path from setuptools import setup, find_packages, Extension -from setuptools.command import test try: from Cython.Distutils import build_ext @@ -35,17 +34,6 @@ del sys.modules[k] -class TestCommand(test.test): - def run_tests(self): - import sys - - import unittest2 - - sys.modules['unittest'] = unittest2 - - return test.test.run_tests(self) - - def get_cpyamf_extensions(): """ Returns a list of all extensions for the cpyamf module. If for some reason @@ -150,7 +138,6 @@ def get_test_requirements(): license = "MIT License", platforms = ["any"], cmdclass = { - 'test': TestCommand, 'build_ext': build_ext, }, extras_require = {