summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYobmod <yobmod@gmail.com>2021-07-19 16:59:30 +0100
committerYobmod <yobmod@gmail.com>2021-07-19 16:59:30 +0100
commit454576254b873b7ebc45bb30846e5831dc2d8817 (patch)
tree853ad35953091faf2b0380793166fc420f1de102
parent6609ef7c3b5bb840dba8d0a5362e67746761a437 (diff)
downloadgitpython-454576254b873b7ebc45bb30846e5831dc2d8817.tar.gz
rmv python 3.5 checks from tests
-rw-r--r--test/lib/helper.py2
-rw-r--r--test/test_base.py12
-rw-r--r--test/test_commit.py2
-rw-r--r--test/test_git.py7
-rw-r--r--test/test_refs.py4
-rw-r--r--test/test_remote.py4
-rw-r--r--test/test_submodule.py3
-rw-r--r--test/test_tree.py5
8 files changed, 15 insertions, 24 deletions
diff --git a/test/lib/helper.py b/test/lib/helper.py
index 3412786d..5dde7b04 100644
--- a/test/lib/helper.py
+++ b/test/lib/helper.py
@@ -336,7 +336,7 @@ class TestBase(TestCase):
- Class level repository which is considered read-only as it is shared among
all test cases in your type.
Access it using::
- self.rorepo # 'ro' stands for read-only
+ self.rorepo # 'ro' stands for read-only
The rorepo is in fact your current project's git repo. If you refer to specific
shas for your objects, be sure you choose some that are part of the immutable portion
diff --git a/test/test_base.py b/test/test_base.py
index 02963ce0..68ce6816 100644
--- a/test/test_base.py
+++ b/test/test_base.py
@@ -9,7 +9,7 @@ import sys
import tempfile
from unittest import SkipTest, skipIf
-from git import (
+from git.objects import (
Blob,
Tree,
Commit,
@@ -18,17 +18,17 @@ from git import (
from git.compat import is_win
from git.objects.util import get_object_type_by_name
from test.lib import (
- TestBase,
+ TestBase as _TestBase,
with_rw_repo,
with_rw_and_rw_remote_repo
)
-from git.util import hex_to_bin
+from git.util import hex_to_bin, HIDE_WINDOWS_FREEZE_ERRORS
import git.objects.base as base
import os.path as osp
-class TestBase(TestBase):
+class TestBase(_TestBase):
def tearDown(self):
import gc
@@ -111,15 +111,13 @@ class TestBase(TestBase):
assert not rw_repo.config_reader("repository").getboolean("core", "bare")
assert osp.isdir(osp.join(rw_repo.working_tree_dir, 'lib'))
- #@skipIf(HIDE_WINDOWS_FREEZE_ERRORS, "FIXME: Freezes! sometimes...")
+ @skipIf(HIDE_WINDOWS_FREEZE_ERRORS, "FIXME: Freezes! sometimes...")
@with_rw_and_rw_remote_repo('0.1.6')
def test_with_rw_remote_and_rw_repo(self, rw_repo, rw_remote_repo):
assert not rw_repo.config_reader("repository").getboolean("core", "bare")
assert rw_remote_repo.config_reader("repository").getboolean("core", "bare")
assert osp.isdir(osp.join(rw_repo.working_tree_dir, 'lib'))
- @skipIf(sys.version_info < (3,) and is_win,
- "Unicode woes, see https://github.com/gitpython-developers/GitPython/pull/519")
@with_rw_repo('0.1.6')
def test_add_unicode(self, rw_repo):
filename = "שלום.txt"
diff --git a/test/test_commit.py b/test/test_commit.py
index 34b91ac7..670068e5 100644
--- a/test/test_commit.py
+++ b/test/test_commit.py
@@ -265,7 +265,7 @@ class TestCommit(TestCommitSerialization):
@with_rw_directory
def test_ambiguous_arg_iteration(self, rw_dir):
rw_repo = Repo.init(osp.join(rw_dir, 'test_ambiguous_arg'))
- path = osp.join(rw_repo.working_tree_dir, 'master')
+ path = osp.join(str(rw_repo.working_tree_dir), 'master')
touch(path)
rw_repo.index.add([path])
rw_repo.index.commit('initial commit')
diff --git a/test/test_git.py b/test/test_git.py
index 72c7ef62..7f52d650 100644
--- a/test/test_git.py
+++ b/test/test_git.py
@@ -18,7 +18,6 @@ from git import (
Repo,
cmd
)
-from git.compat import is_darwin
from test.lib import (
TestBase,
fixture_path
@@ -248,11 +247,7 @@ class TestGit(TestBase):
try:
remote.fetch()
except GitCommandError as err:
- if sys.version_info[0] < 3 and is_darwin:
- self.assertIn('ssh-orig', str(err))
- self.assertEqual(err.status, 128)
- else:
- self.assertIn('FOO', str(err))
+ self.assertIn('FOO', str(err))
def test_handle_process_output(self):
from git.cmd import handle_process_output
diff --git a/test/test_refs.py b/test/test_refs.py
index 8ab45d22..1315f885 100644
--- a/test/test_refs.py
+++ b/test/test_refs.py
@@ -119,14 +119,14 @@ class TestRefs(TestBase):
assert head.tracking_branch() == remote_ref
head.set_tracking_branch(None)
assert head.tracking_branch() is None
-
+
special_name = 'feature#123'
special_name_remote_ref = SymbolicReference.create(rwrepo, 'refs/remotes/origin/%s' % special_name)
gp_tracking_branch = rwrepo.create_head('gp_tracking#123')
special_name_remote_ref = rwrepo.remotes[0].refs[special_name] # get correct type
gp_tracking_branch.set_tracking_branch(special_name_remote_ref)
assert gp_tracking_branch.tracking_branch().path == special_name_remote_ref.path
-
+
git_tracking_branch = rwrepo.create_head('git_tracking#123')
rwrepo.git.branch('-u', special_name_remote_ref.name, git_tracking_branch.name)
assert git_tracking_branch.tracking_branch().name == special_name_remote_ref.name
diff --git a/test/test_remote.py b/test/test_remote.py
index fb7d23c6..c29fac65 100644
--- a/test/test_remote.py
+++ b/test/test_remote.py
@@ -347,7 +347,7 @@ class TestRemote(TestBase):
progress = TestRemoteProgress()
to_be_updated = "my_tag.1.0RV"
new_tag = TagReference.create(rw_repo, to_be_updated) # @UnusedVariable
- other_tag = TagReference.create(rw_repo, "my_obj_tag.2.1aRV", message="my message")
+ other_tag = TagReference.create(rw_repo, "my_obj_tag.2.1aRV", logmsg="my message")
res = remote.push(progress=progress, tags=True)
self.assertTrue(res[-1].flags & PushInfo.NEW_TAG)
progress.make_assertion()
@@ -355,7 +355,7 @@ class TestRemote(TestBase):
# update push new tags
# Rejection is default
- new_tag = TagReference.create(rw_repo, to_be_updated, ref='HEAD~1', force=True)
+ new_tag = TagReference.create(rw_repo, to_be_updated, reference='HEAD~1', force=True)
res = remote.push(tags=True)
self._do_test_push_result(res, remote)
self.assertTrue(res[-1].flags & PushInfo.REJECTED)
diff --git a/test/test_submodule.py b/test/test_submodule.py
index 85191a89..3307bc78 100644
--- a/test/test_submodule.py
+++ b/test/test_submodule.py
@@ -3,7 +3,6 @@
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
import os
import shutil
-import sys
from unittest import skipIf
import git
@@ -421,7 +420,7 @@ class TestSubmodule(TestBase):
def test_base_bare(self, rwrepo):
self._do_base_tests(rwrepo)
- @skipIf(HIDE_WINDOWS_KNOWN_ERRORS and sys.version_info[:2] == (3, 5), """
+ @skipIf(HIDE_WINDOWS_KNOWN_ERRORS, """
File "C:\\projects\\gitpython\\git\\cmd.py", line 559, in execute
raise GitCommandNotFound(command, err)
git.exc.GitCommandNotFound: Cmd('git') not found due to: OSError('[WinError 6] The handle is invalid')
diff --git a/test/test_tree.py b/test/test_tree.py
index 0607d8e3..24c401cb 100644
--- a/test/test_tree.py
+++ b/test/test_tree.py
@@ -5,7 +5,6 @@
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
from io import BytesIO
-import sys
from unittest import skipIf
from git.objects import (
@@ -20,7 +19,7 @@ import os.path as osp
class TestTree(TestBase):
- @skipIf(HIDE_WINDOWS_KNOWN_ERRORS and sys.version_info[:2] == (3, 5), """
+ @skipIf(HIDE_WINDOWS_KNOWN_ERRORS, """
File "C:\\projects\\gitpython\\git\\cmd.py", line 559, in execute
raise GitCommandNotFound(command, err)
git.exc.GitCommandNotFound: Cmd('git') not found due to: OSError('[WinError 6] The handle is invalid')
@@ -53,7 +52,7 @@ class TestTree(TestBase):
testtree._deserialize(stream)
# END for each item in tree
- @skipIf(HIDE_WINDOWS_KNOWN_ERRORS and sys.version_info[:2] == (3, 5), """
+ @skipIf(HIDE_WINDOWS_KNOWN_ERRORS, """
File "C:\\projects\\gitpython\\git\\cmd.py", line 559, in execute
raise GitCommandNotFound(command, err)
git.exc.GitCommandNotFound: Cmd('git') not found due to: OSError('[WinError 6] The handle is invalid')