Skip to content

Commit

Permalink
Run git handler test only if git-lfs is installed
Browse files Browse the repository at this point in the history
The git handler requires git-lfs.
  • Loading branch information
amolenaar committed Nov 25, 2021
1 parent 32bff20 commit d348c92
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions tests/test_model_loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from __future__ import annotations

import pathlib
import subprocess
from importlib import metadata

import pytest
Expand All @@ -23,6 +24,13 @@
from . import TEST_MODEL, TEST_ROOT


def has_git_lfs():
proc = subprocess.run(
["git", "lfs"],
)
return proc.returncode == 0


@pytest.mark.parametrize(
"path",
[
Expand All @@ -34,15 +42,12 @@ def test_model_loading_via_LocalFileHandler(path: str | pathlib.Path):
capellambse.MelodyModel(path)


@pytest.mark.parametrize(
"path",
[
pytest.param(
"git+" + pathlib.Path.cwd().as_uri(), id="From local repo"
),
],
@pytest.mark.skipif(
not has_git_lfs(),
reason="This test requires git-lfs to be present on the system",
)
def test_model_loading_via_GitFileHandler(path: str):
def test_model_loading_via_GitFileHandler():
path = "git+" + pathlib.Path.cwd().as_uri()
capellambse.MelodyModel(
path, entrypoint="tests/data/melodymodel/5_0/MelodyModelTest.aird"
)
Expand Down

0 comments on commit d348c92

Please sign in to comment.