Skip to content

Commit

Permalink
Report <2.5.1 in test_linked_worktree_traversal as error
Browse files Browse the repository at this point in the history
Although GitPython does not require git >=2.5.1 in general, and
this does *not* change that, this makes the unavailability of git
2.5.1 or later an error in test_linked_worktree_traversal, where it
is needed to exercise that test, rather than skipping the test.

A few systems, such as CentOS 7, may have downstream patched
versions of git that remain safe to use yet are numbered <2.5.1
and do not have the necesary feature to run this test. But by now,
users of those systems likely anticipate that other software would
rely on the presence of features added in git 2.5.1, which was
released over 7 years ago. As such, I think it is more useful to
give an error for that test, so the test's inability to be run on
the system is clear, than to automatically skip the test, which is
likely to go unnoticed.
  • Loading branch information
EliahKagan committed Sep 25, 2023
1 parent b3de694 commit 30e86de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/test_fun.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def test_linked_worktree_traversal(self, rw_dir):
"""Check that we can identify a linked worktree based on a .git file"""
git = Git(rw_dir)
if git.version_info[:3] < (2, 5, 1):
raise SkipTest("worktree feature unsupported")
raise RuntimeError("worktree feature unsupported (test needs git 2.5.1 or later)")

rw_master = self.rorepo.clone(join_path_native(rw_dir, "master_repo"))
branch = rw_master.create_head("aaaaaaaa")
Expand Down

0 comments on commit 30e86de

Please sign in to comment.