summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonny Pfannschmidt <opensource@ronnypfannschmidt.de>2020-05-07 06:39:30 +0200
committerGitHub <noreply@github.com>2020-05-07 06:39:30 +0200
commit2732199b5e02b7f1e1681d264dd4a39846d40d95 (patch)
treed2235035f485707ec6e232dfd434b2abcfd68a01
parent197195f52755142a97fa599d32dac83a5b5deb4a (diff)
parentb447ca04f2b0bb6f8a66fc47195f10f1b9ed2be5 (diff)
downloadsetuptools-scm-2732199b5e02b7f1e1681d264dd4a39846d40d95.tar.gz
Merge pull request #426 from mgorny/hg-skip
Skip mercurial tests when hg is not available
-rw-r--r--testing/test_file_finder.py5
-rw-r--r--testing/test_mercurial.py8
2 files changed, 12 insertions, 1 deletions
diff --git a/testing/test_file_finder.py b/testing/test_file_finder.py
index c9409c4..d7b6d11 100644
--- a/testing/test_file_finder.py
+++ b/testing/test_file_finder.py
@@ -15,7 +15,10 @@ def inwd(request, wd, monkeypatch):
wd.add_command = "git add ."
wd.commit_command = "git commit -m test-{reason}"
elif request.param == "hg":
- wd("hg init")
+ try:
+ wd("hg init")
+ except FileNotFoundError:
+ pytest.skip("hg executable not found")
wd.add_command = "hg add ."
wd.commit_command = 'hg commit -m test-{reason} -u test -d "0 0"'
(wd.cwd / "file1").touch()
diff --git a/testing/test_mercurial.py b/testing/test_mercurial.py
index c20c2fd..29370c1 100644
--- a/testing/test_mercurial.py
+++ b/testing/test_mercurial.py
@@ -2,7 +2,15 @@ from setuptools_scm import format_version
from setuptools_scm.hg import archival_to_version, parse
from setuptools_scm import integration
from setuptools_scm.config import Configuration
+from setuptools_scm.utils import has_command
import pytest
+import warnings
+
+
+with warnings.catch_warnings():
+ warnings.filterwarnings("ignore")
+ if not has_command("hg"):
+ pytestmark = pytest.mark.skip(reason="hg executable not found")
@pytest.fixture