fix(tests): use case-insensitive regex in singularity preflight tests

pytest.raises(match=...) is case-sensitive by default. The error
message starts with "Neither" (capital N) but the regex used lowercase
"neither", causing CI failures on Linux.
This commit is contained in:
Muhammet Eren Karakuş
2026-03-16 18:32:56 +03:00
parent 606f57a3ab
commit 43b8ecd172

View File

@@ -39,7 +39,7 @@ class TestFindSingularityExecutable:
def test_raises_when_neither_found(self):
"""Must raise RuntimeError with install instructions."""
with patch("shutil.which", return_value=None):
with pytest.raises(RuntimeError, match="neither.*apptainer.*nor.*singularity"):
with pytest.raises(RuntimeError, match="Neither.*apptainer.*nor.*singularity"):
_find_singularity_executable()
@@ -73,5 +73,5 @@ class TestEnsureSingularityAvailable:
def test_raises_when_not_installed(self):
"""Raises RuntimeError when neither executable exists."""
with patch("shutil.which", return_value=None):
with pytest.raises(RuntimeError, match="neither.*apptainer.*nor.*singularity"):
with pytest.raises(RuntimeError, match="Neither.*apptainer.*nor.*singularity"):
_ensure_singularity_available()