diff options
author | kballou <kballou@devnulllabs.io> | 2015-05-29 18:36:14 -0600 |
---|---|---|
committer | kballou <kballou@devnulllabs.io> | 2015-05-29 18:36:14 -0600 |
commit | ca9a9d504a99ba01dc4a9935cd15a36caed5406e (patch) | |
tree | cbb34bb6de58d752bc6270f0b78675c6ae5962eb | |
parent | 5f51543928a71cf81a9f5e7084cdc7748624eed1 (diff) | |
download | xnt-ca9a9d504a99ba01dc4a9935cd15a36caed5406e.tar.gz xnt-ca9a9d504a99ba01dc4a9935cd15a36caed5406e.tar.xz |
Fix 2.6 python tests
Use `unittest2` module for Python 2.6 tests. Ignore duplicates in imports
and add the requirement to the `setup.py` file.
-rw-r--r-- | pylint.conf | 2 | ||||
-rw-r--r-- | setup.py | 1 | ||||
-rw-r--r-- | xnt/tests/compilercollectiontests.py | 6 | ||||
-rw-r--r-- | xnt/tests/maketests.py | 6 | ||||
-rw-r--r-- | xnt/tests/taskcompressiontests.py | 6 | ||||
-rw-r--r-- | xnt/tests/taskcopytests.py | 6 | ||||
-rw-r--r-- | xnt/tests/taskmisctests.py | 6 | ||||
-rw-r--r-- | xnt/tests/taskmkdirtests.py | 6 | ||||
-rw-r--r-- | xnt/tests/taskmovetests.py | 6 | ||||
-rw-r--r-- | xnt/tests/taskremovetests.py | 6 | ||||
-rw-r--r-- | xnt/tests/textests.py | 6 | ||||
-rw-r--r-- | xnt/tests/vcscvstests.py | 6 | ||||
-rw-r--r-- | xnt/tests/vcsgittests.py | 6 | ||||
-rw-r--r-- | xnt/tests/vcshgtests.py | 6 | ||||
-rw-r--r-- | xnt/tests/xenantargparsertests.py | 6 | ||||
-rw-r--r-- | xnt/tests/xenantparamparsertests.py | 6 |
16 files changed, 72 insertions, 15 deletions
diff --git a/pylint.conf b/pylint.conf index 274bc44..1311152 100644 --- a/pylint.conf +++ b/pylint.conf @@ -175,7 +175,7 @@ ignore-comments=yes ignore-docstrings=yes # Ignore imports when computing similarities. -ignore-imports=no +ignore-imports=yes [CLASSES] @@ -47,6 +47,7 @@ setup( 'xnt = xnt.xenant:main', ], }, + tests_require=['unittest2',], install_requires=['setuptools',], classifiers=[ 'Development Status :: 4 - Beta', diff --git a/xnt/tests/compilercollectiontests.py b/xnt/tests/compilercollectiontests.py index 476476a..3bed441 100644 --- a/xnt/tests/compilercollectiontests.py +++ b/xnt/tests/compilercollectiontests.py @@ -22,7 +22,11 @@ from xnt.tasks.build.cc import __gcc__ from xnt.tasks.build.cc import __gpp__ from xnt.tasks.build.cc import __nvcc__ from xnt.tasks.build.cc import __javac__ -import unittest +import sys +if sys.version_info[0] == 2 and sys.version_info[1] == 6: + import unittest2 as unittest +else: + import unittest # pylint: disable=R0904 class GccTests(unittest.TestCase): diff --git a/xnt/tests/maketests.py b/xnt/tests/maketests.py index ccdd463..a2d7c38 100644 --- a/xnt/tests/maketests.py +++ b/xnt/tests/maketests.py @@ -21,7 +21,11 @@ from xnt.tests import assert_basic_assumptions from xnt.tasks.build.make import __make__ from xnt.tasks.build.make import __ant__ from xnt.tasks.build.make import __nant__ -import unittest +import sys +if sys.version_info[0] == 2 and sys.version_info[1] == 6: + import unittest2 as unittest +else: + import unittest # pylint: disable=R0904 class AntTests(unittest.TestCase): diff --git a/xnt/tests/taskcompressiontests.py b/xnt/tests/taskcompressiontests.py index 3f79625..7a73272 100644 --- a/xnt/tests/taskcompressiontests.py +++ b/xnt/tests/taskcompressiontests.py @@ -19,7 +19,11 @@ from xnt.tests import assert_basic_assumptions from xnt.tasks.core_tasks import __zip__ -import unittest +import sys +if sys.version_info[0] == 2 and sys.version_info[1] == 6: + import unittest2 as unittest +else: + import unittest # pylint: disable=R0904 class TaskCompressionTests(unittest.TestCase): diff --git a/xnt/tests/taskcopytests.py b/xnt/tests/taskcopytests.py index 21ebeee..233ccd8 100644 --- a/xnt/tests/taskcopytests.py +++ b/xnt/tests/taskcopytests.py @@ -19,7 +19,11 @@ from xnt.tests import assert_basic_assumptions from xnt.tasks.core_tasks import __copy__ -import unittest +import sys +if sys.version_info[0] == 2 and sys.version_info[1] == 6: + import unittest2 as unittest +else: + import unittest # pylint: disable=R0904 class TaskCopyTests(unittest.TestCase): diff --git a/xnt/tests/taskmisctests.py b/xnt/tests/taskmisctests.py index 45b374c..b7c32b1 100644 --- a/xnt/tests/taskmisctests.py +++ b/xnt/tests/taskmisctests.py @@ -27,7 +27,11 @@ from xnt.tasks.core_tasks import __which__ from xnt.tasks.core_tasks import __in_path__ from xnt.tasks.core_tasks import __log__ from xnt.tasks.core_tasks import __expandpath__ -import unittest +import sys +if sys.version_info[0] == 2 and sys.version_info[1] == 6: + import unittest2 as unittest +else: + import unittest # pylint: disable=R0904 class TaskMiscTests(unittest.TestCase): diff --git a/xnt/tests/taskmkdirtests.py b/xnt/tests/taskmkdirtests.py index b185955..4a07bab 100644 --- a/xnt/tests/taskmkdirtests.py +++ b/xnt/tests/taskmkdirtests.py @@ -19,7 +19,11 @@ from xnt.tests import assert_basic_assumptions from xnt.tasks.core_tasks import __mkdir__ -import unittest +import sys +if sys.version_info[0] == 2 and sys.version_info[1] == 6: + import unittest2 as unittest +else: + import unittest # pylint: disable=R0904 class TaskMkdirTests(unittest.TestCase): diff --git a/xnt/tests/taskmovetests.py b/xnt/tests/taskmovetests.py index 6578c45..93f2e52 100644 --- a/xnt/tests/taskmovetests.py +++ b/xnt/tests/taskmovetests.py @@ -19,7 +19,11 @@ from xnt.tests import assert_basic_assumptions from xnt.tasks.core_tasks import __move__ -import unittest +import sys +if sys.version_info[0] == 2 and sys.version_info[1] == 6: + import unittest2 as unittest +else: + import unittest # pylint: disable=R0904 class TaskMoveTests(unittest.TestCase): diff --git a/xnt/tests/taskremovetests.py b/xnt/tests/taskremovetests.py index c754de5..c3cb6bf 100644 --- a/xnt/tests/taskremovetests.py +++ b/xnt/tests/taskremovetests.py @@ -19,7 +19,11 @@ from xnt.tests import assert_basic_assumptions from xnt.tasks.core_tasks import __remove__ -import unittest +import sys +if sys.version_info[0] == 2 and sys.version_info[1] == 6: + import unittest2 as unittest +else: + import unittest # pylint: disable=R0904 class TaskRemoveTests(unittest.TestCase): diff --git a/xnt/tests/textests.py b/xnt/tests/textests.py index 0783e1c..15a8779 100644 --- a/xnt/tests/textests.py +++ b/xnt/tests/textests.py @@ -20,7 +20,11 @@ from xnt.tests import assert_basic_assumptions from xnt.tasks.build.tex import __pdflatex__ from xnt.tasks.build.tex import __clean__ -import unittest +import sys +if sys.version_info[0] == 2 and sys.version_info[1] == 6: + import unittest2 as unittest +else: + import unittest # pylint: disable=R0904 class TexTests(unittest.TestCase): diff --git a/xnt/tests/vcscvstests.py b/xnt/tests/vcscvstests.py index 84b14c9..6dcdc95 100644 --- a/xnt/tests/vcscvstests.py +++ b/xnt/tests/vcscvstests.py @@ -20,7 +20,11 @@ from xnt.tests import assert_basic_assumptions from xnt.tasks.vcs.cvs import __cvsco__ from xnt.tasks.vcs.cvs import __cvsupdate__ -import unittest +import sys +if sys.version_info[0] == 2 and sys.version_info[1] == 6: + import unittest2 as unittest +else: + import unittest # pylint: disable=R0904 class VcsCvsTests(unittest.TestCase): diff --git a/xnt/tests/vcsgittests.py b/xnt/tests/vcsgittests.py index afc1ba7..9e8ae96 100644 --- a/xnt/tests/vcsgittests.py +++ b/xnt/tests/vcsgittests.py @@ -20,7 +20,11 @@ from xnt.tests import assert_basic_assumptions from xnt.tasks.vcs.git import __gitclone__ from xnt.tasks.vcs.git import __gitpull__ -import unittest +import sys +if sys.version_info[0] == 2 and sys.version_info[1] == 6: + import unittest2 as unittest +else: + import unittest # pylint: disable=R0904 class VcsGitTests(unittest.TestCase): diff --git a/xnt/tests/vcshgtests.py b/xnt/tests/vcshgtests.py index c702339..93e2d1a 100644 --- a/xnt/tests/vcshgtests.py +++ b/xnt/tests/vcshgtests.py @@ -20,7 +20,11 @@ from xnt.tests import assert_basic_assumptions from xnt.tasks.vcs.hg import __hgclone__ from xnt.tasks.vcs.hg import __hgfetch__ -import unittest +import sys +if sys.version_info[0] == 2 and sys.version_info[1] == 6: + import unittest2 as unittest +else: + import unittest # pylint: disable=R0904 class VcsHgTests(unittest.TestCase): diff --git a/xnt/tests/xenantargparsertests.py b/xnt/tests/xenantargparsertests.py index 3e79a80..d32893a 100644 --- a/xnt/tests/xenantargparsertests.py +++ b/xnt/tests/xenantargparsertests.py @@ -18,7 +18,11 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. import xnt.xenant -import unittest +import sys +if sys.version_info[0] == 2 and sys.version_info[1] == 6: + import unittest2 as unittest +else: + import unittest # pylint: disable=R0904 class XenantArgParserTests(unittest.TestCase): diff --git a/xnt/tests/xenantparamparsertests.py b/xnt/tests/xenantparamparsertests.py index f855dd1..1880185 100644 --- a/xnt/tests/xenantparamparsertests.py +++ b/xnt/tests/xenantparamparsertests.py @@ -18,7 +18,11 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. from xnt.xenant import _process_params_ -import unittest +import sys +if sys.version_info[0] == 2 and sys.version_info[1] == 6: + import unittest2 as unittest +else: + import unittest # pylint: disable=R0904 class XenantParamParserTests(unittest.TestCase): |