Skip to content

Commit 4cae634

Browse files
dedicated apptainer decorator
1 parent 428c25f commit 4cae634

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

tests/test_singularity.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from .util import (
1111
get_data,
1212
get_main_output,
13+
needs_apptainer,
1314
needs_singularity,
1415
needs_singularity_2_6,
1516
needs_singularity_3_or_newer,
@@ -161,8 +162,8 @@ def test_singularity3_docker_image_id_in_tool(tmp_path: Path) -> None:
161162
assert result_code1 == 0
162163

163164

164-
@needs_singularity
165-
def test_singularity_local_sandbox_image(tmp_path: Path):
165+
@needs_apptainer
166+
def test_apptainer_local_sandbox_image(tmp_path: Path):
166167
import subprocess
167168

168169
workdir = tmp_path / "working_dir"
@@ -191,4 +192,4 @@ def test_singularity_local_sandbox_image(tmp_path: Path):
191192
)
192193
assert result_code == 0
193194
else:
194-
pytest.skip(f"Failed to build the Singularity image: {build.stderr}")
195+
pytest.skip(f"Failed to build the Apptainer image: {build.stderr}")

tests/util.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ def get_data(filename: str) -> str:
4040
filepath = Path(os.path.dirname(__file__)) / ".." / filename
4141
return str(filepath.resolve())
4242

43+
needs_apptainer = pytest.mark.skipif(
44+
not bool(shutil.which("apptainer")),
45+
reason="Requires the apptainer executable on the system path.",
46+
)
4347

4448
needs_docker = pytest.mark.skipif(
4549
not bool(shutil.which("docker")),

0 commit comments

Comments
 (0)