summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
Diffstat (limited to 'testing')
-rw-r--r--testing/test_config.py5
-rw-r--r--testing/test_git.py8
-rw-r--r--testing/test_version.py1
3 files changed, 13 insertions, 1 deletions
diff --git a/testing/test_config.py b/testing/test_config.py
index b8ea265..49f1d7a 100644
--- a/testing/test_config.py
+++ b/testing/test_config.py
@@ -11,6 +11,10 @@ import pytest
("apache-arrow-0.9.0", "0.9.0"),
("arrow-0.9.0", "0.9.0"),
("arrow-0.9.0-rc", "0.9.0-rc"),
+ ("arrow-1", "1"),
+ ("arrow-1+", "1"),
+ ("arrow-1+foo", "1"),
+ ("arrow-1.1+foo", "1.1"),
("v1.1", "v1.1"),
("V1.1", "V1.1"),
],
@@ -18,6 +22,7 @@ import pytest
def test_tag_regex(tag, expected_version):
config = Configuration()
match = config.tag_regex.match(tag)
+ assert match
version = match.group("version")
assert version == expected_version
diff --git a/testing/test_git.py b/testing/test_git.py
index 337efdd..8416571 100644
--- a/testing/test_git.py
+++ b/testing/test_git.py
@@ -233,6 +233,14 @@ def test_not_matching_tags(wd):
).startswith("0.11.2")
+@pytest.mark.issue("https://github.com/pypa/setuptools_scm/issues/411")
+def test_non_dotted_version(wd):
+ wd.commit_testfile()
+ wd("git tag apache-arrow-1")
+ wd.commit_testfile()
+ assert wd.get_version().startswith("2")
+
+
@pytest.mark.issue("https://github.com/pypa/setuptools_scm/issues/381")
def test_gitdir(monkeypatch, wd):
"""
diff --git a/testing/test_version.py b/testing/test_version.py
index a287a0d..459d24b 100644
--- a/testing/test_version.py
+++ b/testing/test_version.py
@@ -53,7 +53,6 @@ def test_next_semver(version, expected_next):
)
def test_tag_regex1(tag, expected):
config = Configuration()
- config.tag_regex = r"^(?P<prefix>v)?(?P<version>[^\+]+)(?P<suffix>.*)?$"
if "+" in tag:
# pytest bug wrt cardinality
with pytest.warns(UserWarning):