diff options
author | Harmon <Harmon758@gmail.com> | 2020-02-07 05:56:27 -0600 |
---|---|---|
committer | Sebastian Thiel <sebastian.thiel@icloud.com> | 2020-02-08 10:55:50 +0800 |
commit | 6aa78cd3b969ede76a1a6e660962e898421d4ed8 (patch) | |
tree | 5eb2363fb7d727770da0b00c6a3fc081470cbd06 /git/test | |
parent | e633cc009fe3dc8d29503b0d14532dc5e8c44cce (diff) | |
download | gitpython-6aa78cd3b969ede76a1a6e660962e898421d4ed8.tar.gz |
Remove checks for Python 2 and/or 3
Diffstat (limited to 'git/test')
-rw-r--r-- | git/test/test_fun.py | 1 | ||||
-rw-r--r-- | git/test/test_git.py | 12 | ||||
-rw-r--r-- | git/test/test_index.py | 6 | ||||
-rw-r--r-- | git/test/test_repo.py | 6 |
4 files changed, 4 insertions, 21 deletions
diff --git a/git/test/test_fun.py b/git/test/test_fun.py index 314fb734..d5d0dde9 100644 --- a/git/test/test_fun.py +++ b/git/test/test_fun.py @@ -287,7 +287,6 @@ class TestFun(TestBase): r = tree_entries_from_data(b'100644 \x9f\0aaa') assert r == [('aaa', 33188, u'\udc9f')], r - @skipIf(not PY3, 'odd types returned ... maybe figure it out one day') def test_tree_entries_from_data_with_failing_name_decode_py3(self): r = tree_entries_from_data(b'100644 \x9f\0aaa') assert r == [(b'aaa', 33188, '\udc9f')], r diff --git a/git/test/test_git.py b/git/test/test_git.py index 357d9edb..e6bc19d1 100644 --- a/git/test/test_git.py +++ b/git/test/test_git.py @@ -17,7 +17,7 @@ from git import ( Repo, cmd ) -from git.compat import PY3, is_darwin +from git.compat import is_darwin from git.test.lib import ( TestBase, patch, @@ -61,18 +61,12 @@ class TestGit(TestBase): def test_call_unpack_args_unicode(self): args = Git._Git__unpack_args(u'Unicode€™') - if PY3: - mangled_value = 'Unicode\u20ac\u2122' - else: - mangled_value = 'Unicode\xe2\x82\xac\xe2\x84\xa2' + mangled_value = 'Unicode\u20ac\u2122' assert_equal(args, [mangled_value]) def test_call_unpack_args(self): args = Git._Git__unpack_args(['git', 'log', '--', u'Unicode€™']) - if PY3: - mangled_value = 'Unicode\u20ac\u2122' - else: - mangled_value = 'Unicode\xe2\x82\xac\xe2\x84\xa2' + mangled_value = 'Unicode\u20ac\u2122' assert_equal(args, ['git', 'log', '--', mangled_value]) @raises(GitCommandError) diff --git a/git/test/test_index.py b/git/test/test_index.py index 9b8c957e..4a23ceb1 100644 --- a/git/test/test_index.py +++ b/git/test/test_index.py @@ -25,7 +25,7 @@ from git import ( GitCommandError, CheckoutError, ) -from git.compat import string_types, is_win, PY3 +from git.compat import string_types, is_win from git.exc import ( HookExecutionError, InvalidGitRepositoryError @@ -821,10 +821,6 @@ class TestIndex(TestBase): asserted = True assert asserted, "Adding using a filename is not correctly asserted." - @skipIf(HIDE_WINDOWS_KNOWN_ERRORS and not PY3, r""" - FIXME: File "C:\projects\gitpython\git\util.py", line 125, in to_native_path_linux - return path.replace('\\', '/') - UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 0: ordinal not in range(128)""") @with_rw_directory def test_add_utf8P_path(self, rw_dir): # NOTE: fp is not a Unicode object in python 2 (which is the source of the problem) diff --git a/git/test/test_repo.py b/git/test/test_repo.py index ef28c74e..2d38f150 100644 --- a/git/test/test_repo.py +++ b/git/test/test_repo.py @@ -37,7 +37,6 @@ from git import ( GitCommandError ) from git.compat import ( - PY3, is_win, string_types, win_encode, @@ -526,11 +525,6 @@ class TestRepo(TestBase): num_test_untracked += join_path_native(base, utfile) in files self.assertEqual(len(files), num_test_untracked) - if is_win and not PY3 and is_invoking_git: - ## On Windows, shell needed when passing unicode cmd-args. - # - repo_add = fnt.partial(repo_add, shell=True) - untracked_files = [win_encode(f) for f in untracked_files] repo_add(untracked_files) self.assertEqual(len(rwrepo.untracked_files), (num_recently_untracked - len(files))) # end for each run |