diff options
Diffstat (limited to 'testing/test_git.py')
-rw-r--r-- | testing/test_git.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/testing/test_git.py b/testing/test_git.py index 6f5246c..1b57fed 100644 --- a/testing/test_git.py +++ b/testing/test_git.py @@ -7,7 +7,6 @@ import pytest from datetime import datetime from os.path import join as opj from setuptools_scm.file_finder_git import git_find_files -import warnings skip_if_win_27 = pytest.mark.skipif( @@ -16,10 +15,9 @@ skip_if_win_27 = pytest.mark.skipif( ) -with warnings.catch_warnings(): - warnings.filterwarnings("ignore") - if not has_command("git"): - pytestmark = pytest.mark.skip(reason="git executable not found") +pytestmark = pytest.mark.skipif( + not has_command("git", warn=False), reason="git executable not found" +) @pytest.fixture @@ -59,6 +57,12 @@ setup(use_scm_version={"root": "../..", assert res == "0.1.dev0" +def test_git_gone(wd, monkeypatch): + monkeypatch.setenv("PATH", str(wd.cwd / "not-existing")) + with pytest.raises(EnvironmentError, match="'git' was not found"): + git.parse(str(wd.cwd), git.DEFAULT_DESCRIBE) + + @pytest.mark.issue("https://github.com/pypa/setuptools_scm/issues/298") @pytest.mark.issue(403) def test_file_finder_no_history(wd, caplog): |