summaryrefslogtreecommitdiff
path: root/testing/test_git.py
diff options
context:
space:
mode:
authorRonny Pfannschmidt <opensource@ronnypfannschmidt.de>2023-04-03 17:08:18 +0200
committerRonny Pfannschmidt <opensource@ronnypfannschmidt.de>2023-04-03 17:08:18 +0200
commitf6d8be8caff12d4a9e35c91aada14841cdbcae86 (patch)
tree19346e9f0ea91a3b141ea364766131893f4f2de7 /testing/test_git.py
parentc74126382c636f364382508d97cf43c1df58b347 (diff)
downloadsetuptools-scm-f6d8be8caff12d4a9e35c91aada14841cdbcae86.tar.gz
breaking: unify version.distance to int
the difference between distance=0 and distance=None was hiding issues
Diffstat (limited to 'testing/test_git.py')
-rw-r--r--testing/test_git.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/testing/test_git.py b/testing/test_git.py
index 75e3664..53571cb 100644
--- a/testing/test_git.py
+++ b/testing/test_git.py
@@ -70,7 +70,7 @@ setup(use_scm_version={"root": "../..",
"""
)
res = run([sys.executable, "setup.py", "--version"], p)
- assert res.stdout == "0.1.dev0"
+ assert res.stdout == "0.1.dev0+d20090213"
def test_root_search_parent_directories(
@@ -85,7 +85,7 @@ setup(use_scm_version={"search_parent_directories": True})
"""
)
res = run([sys.executable, "setup.py", "--version"], p)
- assert res.stdout == "0.1.dev0"
+ assert res.stdout == "0.1.dev0+d20090213"
def test_git_gone(wd: WorkDir, monkeypatch: pytest.MonkeyPatch) -> None:
@@ -146,7 +146,7 @@ def test_not_owner(wd: WorkDir) -> None:
def test_version_from_git(wd: WorkDir) -> None:
- assert wd.version == "0.1.dev0"
+ assert wd.version == "0.1.dev0+d20090213"
parsed = git.parse(str(wd.cwd), Configuration(), git.DEFAULT_DESCRIBE)
assert parsed is not None and parsed.branch in ("master", "main")
@@ -253,7 +253,8 @@ def test_unicode_version_scheme(wd: WorkDir) -> None:
def test_git_worktree(wd: WorkDir) -> None:
wd.write("test.txt", "test2")
# untracked files dont change the state
- assert wd.version == "0.1.dev0"
+ assert wd.version == "0.1.dev0+d20090213"
+
wd("git add test.txt")
assert wd.version.startswith("0.1.dev0+d")