diff options
author | Ilya Etingof <ietingof@redhat.com> | 2017-02-11 01:27:16 +0100 |
---|---|---|
committer | Ilya Etingof <ietingof@redhat.com> | 2017-02-11 01:27:16 +0100 |
commit | 092b5df21281e6d1606b3f7503b714fe55757340 (patch) | |
tree | d9aed6278f458bb828a25081450b51a58001a809 /setup.py | |
parent | b967311a7b7471d97c4d085ee8123ab61eb51b1f (diff) | |
download | pyasn1-git-092b5df21281e6d1606b3f7503b714fe55757340.tar.gz |
test suite simplified and unified
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 35 |
1 files changed, 17 insertions, 18 deletions
@@ -58,6 +58,7 @@ try: params = { 'zip_safe': True } + except ImportError: for arg in sys.argv: if 'egg' in arg: @@ -89,30 +90,28 @@ params.update({ 'pyasn1.codec.native']}) # handle unittest discovery feature -if sys.version_info[0:2] < (2, 7) or \ - sys.version_info[0:2] in ((3, 0), (3, 1)): - try: - import unittest2 as unittest - except ImportError: - unittest = None -else: +try: + import unittest2 as unittest +except ImportError: import unittest -if unittest: - class PyTest(Command): - user_options = [] - def initialize_options(self): - pass +class PyTest(Command): + user_options = [] + + def initialize_options(self): + pass - def finalize_options(self): - pass + def finalize_options(self): + pass - def run(self): - suite = unittest.defaultTestLoader.discover('.') - unittest.TextTestRunner(verbosity=2).run(suite) + def run(self): + suite = unittest.TestLoader().loadTestsFromNames( + ['test.__main__.suite'] + ) + unittest.TextTestRunner(verbosity=2).run(suite) - params['cmdclass'] = {'test': PyTest} +params['cmdclass'] = {'test': PyTest} setup(**params) |