Skip to content

Commit b26710a

Browse files
Merge pull request #375 from layday/test-pyproject-integration
Test pyproject.toml integration using git
2 parents bf07307 + bea6977 commit b26710a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

testing/test_integration.py

Lines changed: 22 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,13 @@ 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(reason="#174")
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("""[tool.setuptools_scm]""")
36+
pkg.join("setup.py").write("__import__('setuptools').setup()")
37+
res = do((sys.executable, "setup.py", "--version"), pkg)
38+
assert res == "0.1.dev0"

0 commit comments

Comments
 (0)