Skip to content

Commit 19a0c37

Browse files
committed
environment tests: clear the singularity image cache
1 parent 3ef7a1c commit 19a0c37

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/test_environment.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import pytest
1010
from packaging.version import Version
1111

12-
from cwltool.singularity import get_version
12+
from cwltool.singularity import _IMAGES, _IMAGES_LOCK, get_version
1313

1414
from .util import env_accepts_null, get_tool_env, needs_docker, needs_singularity
1515

@@ -22,6 +22,12 @@
2222
EnvChecks = dict[str, CheckerTypes]
2323

2424

25+
@pytest.fixture(autouse=True)
26+
def clear_singularity_image_cache() -> None:
27+
with _IMAGES_LOCK:
28+
_IMAGES.clear()
29+
30+
2531
def assert_envvar_matches(check: CheckerTypes, k: str, env: Mapping[str, str]) -> None:
2632
"""Assert that the check is satisfied by the key in the env."""
2733
if check is None:

0 commit comments

Comments
 (0)