summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorIonel Cristian Mărieș <contact@ionelmc.ro>2019-05-10 13:49:11 +0300
committerIonel Cristian Mărieș <contact@ionelmc.ro>2019-05-10 13:55:33 +0300
commitea4a6e5eb885a2f013e1b3e5374476dceec2a2fa (patch)
treee2003f220390ea04d4c190f2f80ff41ba9a77d48 /testing
parentd1ac9d1e0fabc0905a3c854004ac8fd57117ea6d (diff)
downloadsetuptools-scm-ea4a6e5eb885a2f013e1b3e5374476dceec2a2fa.tar.gz
Use a different root for fallbacks. Remove old hack that merely checked entrypoint existence (and not if results are valid). Ref #333.
Diffstat (limited to 'testing')
-rw-r--r--testing/test_git.py15
-rw-r--r--testing/test_regressions.py2
2 files changed, 16 insertions, 1 deletions
diff --git a/testing/test_git.py b/testing/test_git.py
index a889293..4d6b653 100644
--- a/testing/test_git.py
+++ b/testing/test_git.py
@@ -1,3 +1,5 @@
+import sys
+
from setuptools_scm import integration
from setuptools_scm.utils import do
from setuptools_scm import git
@@ -29,6 +31,19 @@ def test_parse_describe_output(given, tag, number, node, dirty):
assert parsed == (tag, number, node, dirty)
+def test_root_relative_to(tmpdir, wd, monkeypatch):
+ monkeypatch.delenv("SETUPTOOLS_SCM_DEBUG")
+ p = wd.cwd.ensure("sub/package", dir=1)
+ p.join("setup.py").write(
+ """from setuptools import setup
+setup(use_scm_version={"root": "../..",
+ "relative_to": __file__})
+"""
+ )
+ res = do((sys.executable, "setup.py", "--version"), p)
+ assert res == "0.1.dev0"
+
+
@pytest.mark.issue("https://github.com/pypa/setuptools_scm/issues/298")
def test_file_finder_no_history(wd, caplog):
file_list = git_find_files(str(wd.cwd))
diff --git a/testing/test_regressions.py b/testing/test_regressions.py
index 702cbf2..9327244 100644
--- a/testing/test_regressions.py
+++ b/testing/test_regressions.py
@@ -29,7 +29,7 @@ def test_pkginfo_noscmroot(tmpdir, monkeypatch):
do("git init", p.dirpath())
res = do((sys.executable, "setup.py", "--version"), p)
- assert res == "1.0"
+ assert res == "0.1.dev0"
def test_pip_egg_info(tmpdir, monkeypatch):