Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions torchbase/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import toml
import csv
from unittest import mock
import os

# Mock ipyfs if it's not available
try:
Expand All @@ -17,6 +18,45 @@
sys.modules['ipyfs'] = ipyfs_mock


@pytest.fixture(scope="session", autouse=True)
def configure_miniwdl_local_backend():
"""Configure miniwdl to use local backend instead of Docker for tests.

This allows workflow tests to run in environments without Docker.
"""
# Create a temporary config file for miniwdl
config_dir = Path(tempfile.gettempdir()) / "miniwdl_test_config"
config_dir.mkdir(exist_ok=True)
config_file = config_dir / "miniwdl.toml"

config_content = """
[task_runtime]
docker = false

[runtime]
backends = ["local"]

[exe]
allow_docker_fallback = false
"""

config_file.write_text(config_content)

# Set environment variable to use this config
os.environ["WDL_CFG_PATH"] = str(config_file)

yield

# Cleanup
if config_file.exists():
config_file.unlink()
if config_dir.exists():
try:
config_dir.rmdir()
except OSError:
pass


@pytest.fixture
def multi_scheme_torch_tempdir():
"""Create a temporary multi-scheme torch directory structure.
Expand Down
Loading
Loading