diff options
author | Hugo <hugovk@users.noreply.github.com> | 2018-03-18 12:06:10 +0200 |
---|---|---|
committer | Hugo <hugovk@users.noreply.github.com> | 2018-03-18 22:26:04 +0200 |
commit | 929f3e1e1b664ed8cdef90a40c96804edfd08d59 (patch) | |
tree | 805c06bde21a6c4b3d9defe775527a3773bef3b9 /git/test | |
parent | 190c04569bd2a29597065222cdcc322ec4f2b374 (diff) | |
download | gitpython-929f3e1e1b664ed8cdef90a40c96804edfd08d59.tar.gz |
Drop support for EOL Python 2.6
Diffstat (limited to 'git/test')
-rw-r--r-- | git/test/lib/helper.py | 7 | ||||
-rw-r--r-- | git/test/test_base.py | 5 | ||||
-rw-r--r-- | git/test/test_fun.py | 6 | ||||
-rw-r--r-- | git/test/test_index.py | 13 | ||||
-rw-r--r-- | git/test/test_remote.py | 5 | ||||
-rw-r--r-- | git/test/test_repo.py | 11 | ||||
-rw-r--r-- | git/test/test_submodule.py | 5 | ||||
-rw-r--r-- | git/test/test_tree.py | 5 | ||||
-rw-r--r-- | git/test/test_util.py | 5 |
9 files changed, 10 insertions, 52 deletions
diff --git a/git/test/lib/helper.py b/git/test/lib/helper.py index cb46173d..1c06010f 100644 --- a/git/test/lib/helper.py +++ b/git/test/lib/helper.py @@ -15,6 +15,7 @@ import sys import tempfile import textwrap import time +import unittest from git.compat import string_types, is_win from git.util import rmtree, cwd @@ -23,11 +24,6 @@ import gitdb import os.path as osp -if sys.version_info[0:2] == (2, 6): - import unittest2 as unittest -else: - import unittest - TestCase = unittest.TestCase SkipTest = unittest.SkipTest skipIf = unittest.skipIf @@ -348,7 +344,6 @@ class TestBase(TestCase): of the project history ( to assure tests don't fail for others ). """ - # On py26, unittest2 has assertRaisesRegex # On py3, unittest has assertRaisesRegex # On py27, we use unittest, which names it differently: if sys.version_info[0:2] == (2, 7): diff --git a/git/test/test_base.py b/git/test/test_base.py index 69f161be..2132806b 100644 --- a/git/test/test_base.py +++ b/git/test/test_base.py @@ -7,10 +7,7 @@ import os import sys import tempfile -try: - from unittest import SkipTest, skipIf -except ImportError: - from unittest2 import SkipTest, skipIf +from unittest import SkipTest, skipIf from git import ( Blob, diff --git a/git/test/test_fun.py b/git/test/test_fun.py index 5e32a1f9..d5e6e50d 100644 --- a/git/test/test_fun.py +++ b/git/test/test_fun.py @@ -2,11 +2,7 @@ from io import BytesIO from stat import S_IFDIR, S_IFREG, S_IFLNK from os import stat import os.path as osp - -try: - from unittest import skipIf, SkipTest -except ImportError: - from unittest2 import skipIf, SkipTest +from unittest import skipIf, SkipTest from git import Git from git.compat import PY3 diff --git a/git/test/test_index.py b/git/test/test_index.py index 757bec9f..73123d6b 100644 --- a/git/test/test_index.py +++ b/git/test/test_index.py @@ -11,12 +11,8 @@ from stat import ( S_ISLNK, ST_MODE ) -import sys import tempfile -try: - from unittest import skipIf -except ImportError: - from unittest2 import skipIf +from unittest import skipIf from git import ( IndexFile, @@ -168,9 +164,7 @@ class TestIndex(TestBase): except Exception as ex: msg_py3 = "required argument is not an integer" msg_py2 = "cannot convert argument to integer" - msg_py26 = "unsupported operand type(s) for &: 'str' and 'long'" - assert msg_py2 in str(ex) or msg_py3 in str(ex) or \ - msg_py26 in str(ex), str(ex) + assert msg_py2 in str(ex) or msg_py3 in str(ex) ## 2nd time should not fail due to stray lock file try: @@ -180,9 +174,6 @@ class TestIndex(TestBase): @with_rw_repo('0.1.6') def test_index_file_from_tree(self, rw_repo): - if sys.version_info < (2, 7): - ## Skipped, not `assertRaisesRegexp` in py2.6 - return common_ancestor_sha = "5117c9c8a4d3af19a9958677e45cda9269de1541" cur_sha = "4b43ca7ff72d5f535134241e7c797ddc9c7a3573" other_sha = "39f85c4358b7346fee22169da9cad93901ea9eb9" diff --git a/git/test/test_remote.py b/git/test/test_remote.py index ad9210f6..35924ca2 100644 --- a/git/test/test_remote.py +++ b/git/test/test_remote.py @@ -6,10 +6,7 @@ import random import tempfile -try: - from unittest import skipIf -except ImportError: - from unittest2 import skipIf +from unittest import skipIf from git import ( RemoteProgress, diff --git a/git/test/test_repo.py b/git/test/test_repo.py index 2c3ad957..6985f254 100644 --- a/git/test/test_repo.py +++ b/git/test/test_repo.py @@ -9,12 +9,8 @@ from io import BytesIO import itertools import os import pickle -import sys import tempfile -try: - from unittest import skipIf, SkipTest -except ImportError: - from unittest2 import skipIf, SkipTest +from unittest import skipIf, SkipTest try: import pathlib @@ -364,9 +360,6 @@ class TestRepo(TestBase): @patch.object(Git, '_call_process') def test_should_display_blame_information(self, git): - if sys.version_info < (2, 7): - ## Skipped, not `assertRaisesRegexp` in py2.6 - return git.return_value = fixture('blame') b = self.rorepo.blame('master', 'lib/git.py') assert_equal(13, len(b)) @@ -792,8 +785,6 @@ class TestRepo(TestBase): def test_repo_odbtype(self): target_type = GitCmdObjectDB - if sys.version_info[:2] < (2, 5): - target_type = GitCmdObjectDB self.assertIsInstance(self.rorepo.odb, target_type) def test_submodules(self): diff --git a/git/test/test_submodule.py b/git/test/test_submodule.py index 5c8a2798..3b15c095 100644 --- a/git/test/test_submodule.py +++ b/git/test/test_submodule.py @@ -3,10 +3,7 @@ # the BSD License: http://www.opensource.org/licenses/bsd-license.php import os import sys -try: - from unittest import skipIf -except ImportError: - from unittest2 import skipIf +from unittest import skipIf import git from git.cmd import Git diff --git a/git/test/test_tree.py b/git/test/test_tree.py index 5fd4d760..f3376e23 100644 --- a/git/test/test_tree.py +++ b/git/test/test_tree.py @@ -6,10 +6,7 @@ from io import BytesIO import sys -try: - from unittest import skipIf -except ImportError: - from unittest2 import skipIf +from unittest import skipIf from git import ( Tree, diff --git a/git/test/test_util.py b/git/test/test_util.py index d30c8376..b7925c84 100644 --- a/git/test/test_util.py +++ b/git/test/test_util.py @@ -6,10 +6,7 @@ import tempfile import time -try: - from unittest import skipIf -except ImportError: - from unittest2 import skipIf +from unittest import skipIf import ddt |