Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion testing/test_mercurial.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def test_latest_tag_detection(wd):
""" Tests that tags not containing a "." are ignored, the same as for git.
Note that will be superceded by the fix for pypa/setuptools_scm/issues/235
"""
wd('hg tag some-random-tag')
wd('hg tag some-random-tag -u test -d "0 0"')
assert wd.version == '1.0.0'


Expand Down
25 changes: 16 additions & 9 deletions testing/test_setuptools_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@
import os
import subprocess
import pytest
pytestmark = pytest.mark.skipif(
"sys.version_info >= (3,6,0)",
reason="integration with old versions no longer needed on py3.6+")
pytestmark = [
pytest.mark.skipif(
"sys.version_info >= (3,6,0)",
reason="integration with old versions no longer needed on py3.6+"),
pytest.mark.xfail(
sys.platform == 'win32',
reason="path behaves unexpected on windows ci"),
]


@pytest.fixture(scope='session')
Expand All @@ -26,35 +31,37 @@ def makeinstall(version):


SCRIPT = """
from __future__ import print_function
import sys
import setuptools
print(setuptools.__version__)
print(setuptools.__version__, 'expected', sys.argv[1])
import setuptools_scm.version
from setuptools_scm.__main__ import main
main()
"""


def check(packagedir, **env):
def check(packagedir, expected_version, **env):
subprocess.check_call(
[sys.executable, '-c', SCRIPT],
[sys.executable, '-c', SCRIPT, expected_version],
env=dict(os.environ, PYTHONPATH=".:" + str(packagedir), **env))


def test_old_setuptools_fails(get_setuptools_packagedir):
packagedir = get_setuptools_packagedir("0.9.8")
with pytest.raises(subprocess.CalledProcessError):
check(packagedir)
check(packagedir, "0.9.8")


def test_old_setuptools_allows_with_warnings(get_setuptools_packagedir):

packagedir = get_setuptools_packagedir("0.9.8")
# filter using warning since in the early python startup
check(
packagedir,
packagedir, "0.9.8",
PYTHONWARNINGS="once::Warning")


def test_distlib_setuptools_works(get_setuptools_packagedir):
packagedir = get_setuptools_packagedir("12.0.1")
check(packagedir)
check(packagedir, "12.0.1")