aboutsummaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/setup.py b/setup.py
index 0b7906d..309ccde 100644
--- a/setup.py
+++ b/setup.py
@@ -98,4 +98,33 @@ params.update(
'packages': ['pyasn1_modules']}
)
+
+# handle unittest discovery feature
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
+
+
+class PyTest(Command):
+ user_options = []
+
+ def initialize_options(self):
+ pass
+
+ def finalize_options(self):
+ pass
+
+ def run(self):
+ suite = unittest.TestLoader().loadTestsFromNames(
+ ['tests.__main__.suite']
+ )
+
+ unittest.TextTestRunner(verbosity=2).run(suite)
+
+params['cmdclass'] = {
+ 'test': PyTest,
+ 'tests': PyTest
+}
+
setup(**params)