mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
tests: Ensure the git tag version check does not run for tarball builds
Do not try to determine the latest git tag if we're not in a git repository in the first place.
This commit is contained in:
parent
34c12a7b78
commit
c2ba93cb61
1 changed files with 9 additions and 7 deletions
|
@ -90,13 +90,15 @@ class TestVersion(TestCase):
|
|||
# corresponding to "compiled from git" or "compiled from tarball"
|
||||
version = out.split()
|
||||
|
||||
if 2 >= len(version) > 0:
|
||||
git = version[1]
|
||||
git_expected = "({0})".format(self.slurp_git())
|
||||
self.assertEqual(git_expected, git)
|
||||
else:
|
||||
raise ValueError("Unexpected output from _version '{0}'".format(
|
||||
out))
|
||||
# If we are within a git repository, check the tag version
|
||||
if os.path.exists("../.git"):
|
||||
if 2 >= len(version) > 0:
|
||||
git = version[1]
|
||||
git_expected = "({0})".format(self.slurp_git())
|
||||
self.assertEqual(git_expected, git)
|
||||
else:
|
||||
raise ValueError("Unexpected output from _version '{0}'".format(
|
||||
out))
|
||||
|
||||
ver = version[0]
|
||||
ver_expected = self.slurp()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue