diff --git a/tests/test_fmi.py b/tests/test_fmi.py index 35072845..0f00a72b 100644 --- a/tests/test_fmi.py +++ b/tests/test_fmi.py @@ -28,6 +28,7 @@ import xml.etree.ElementTree as ET import re import platform +from packaging import version from pyfmi.fmi import ( FMUException, @@ -88,6 +89,14 @@ def solve(self): TEST_FMU_PATH = Path(file_path) / 'files' / 'test_fmus' TEST_FMU_FMI2_ME_PATH = TEST_FMU_PATH / '2.0' / 'me' +GLIBC_VERSION = platform.libc_ver()[1] + +uses_test_fmus = pytest.mark.skipif( + (platform.system() != "Linux") or + (version.parse(GLIBC_VERSION) < version.parse("2.33")), + reason = "Linux only binaries & requires glibc >= 2.33" +) + # TODO: Many tests here could be parameterized # However, in many cases this relies on having FMUs with the same functionality # available for different FMI versions. @@ -1667,7 +1676,7 @@ def test_load_xml(self, fmu_path, test_class): model = test_class(fmu_path, _connect_dll=False) assert model.get_name() == "CoupledClutches" -@pytest.mark.skipif(platform.system() != "Linux", reason = "Only Linux binaries") +@uses_test_fmus @pytest.mark.parametrize("fmu_path", [ TEST_FMU_FMI2_ME_PATH / "testModels_noStateAssertFailureFunctionLocalVariable.fmu",