Skip to content

Commit 24c24ab

Browse files
committed
Test pyproject.toml integration using git
See #374.
1 parent bf07307 commit 24c24ab

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

testing/test_integration.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
import sys
22

3+
import pytest
4+
35
from setuptools_scm.utils import do
46

57

8+
@pytest.fixture
9+
def wd(wd):
10+
wd("git init")
11+
wd("git config user.email [email protected]")
12+
wd('git config user.name "a test"')
13+
wd.add_command = "git add ."
14+
wd.commit_command = "git commit -m test-{reason}"
15+
return wd
16+
17+
618
def test_pyproject_support(tmpdir, monkeypatch):
719
monkeypatch.delenv("SETUPTOOLS_SCM_DEBUG")
820
pkg = tmpdir.ensure("package", dir=42)
@@ -14,3 +26,15 @@ def test_pyproject_support(tmpdir, monkeypatch):
1426
pkg.join("setup.py").write("__import__('setuptools').setup()")
1527
res = do((sys.executable, "setup.py", "--version"), pkg)
1628
assert res == "12.34"
29+
30+
31+
@pytest.mark.xfail
32+
def test_pyproject_support_with_git(tmpdir, monkeypatch, wd):
33+
monkeypatch.delenv("SETUPTOOLS_SCM_DEBUG")
34+
pkg = tmpdir.join("wd")
35+
pkg.join("pyproject.toml").write(
36+
"""[tool.setuptools_scm]"""
37+
)
38+
pkg.join("setup.py").write("__import__('setuptools').setup()")
39+
res = do((sys.executable, "setup.py", "--version"), pkg)
40+
assert res == "0.1.dev0"

0 commit comments

Comments
 (0)