Skip to content

Commit 7541bb2

Browse files
committed
Pick the available container environment for testing
1 parent 34c0b0e commit 7541bb2

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

tests/conftest.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import os
2+
import shutil
3+
4+
5+
def pytest_configure(config):
6+
"""Auto-detect container runtime if CODECLASH_RUNTIME is not already set."""
7+
if "CODECLASH_RUNTIME" not in os.environ:
8+
if shutil.which("docker"):
9+
os.environ["CODECLASH_RUNTIME"] = "docker"
10+
elif shutil.which("singularity"):
11+
os.environ["CODECLASH_RUNTIME"] = "singularity"

0 commit comments

Comments
 (0)