diff --git a/spacy/tests/test_cli_app.py b/spacy/tests/test_cli_app.py index 8aaadf686..9ba4f0e5c 100644 --- a/spacy/tests/test_cli_app.py +++ b/spacy/tests/test_cli_app.py @@ -5,10 +5,18 @@ import srsly from typer.testing import CliRunner from spacy.tokens import DocBin, Doc -from spacy.cli._util import app +from spacy.cli._util import app, get_git_version from .util import make_tempdir, normalize_whitespace +def has_git(): + try: + get_git_version() + return True + except RuntimeError: + return False + + def test_convert_auto(): with make_tempdir() as d_in, make_tempdir() as d_out: for f in ["data1.iob", "data2.iob", "data3.iob"]: @@ -181,6 +189,7 @@ def test_project_run(project_dir): assert "okokok" in result.stdout +@pytest.mark.skipif(not has_git(), reason="git not installed") @pytest.mark.parametrize( "options", [