Skip to content

Commit 834aafb

Browse files
committed
test: non-freqai tests should run without torch installed
1 parent fe8c367 commit 834aafb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/conftest.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,11 @@ def patch_torch_initlogs(mocker) -> None:
521521
mocked_module = types.ModuleType(module_name)
522522
sys.modules[module_name] = mocked_module
523523
else:
524-
mocker.patch("torch._logging._init_logs")
524+
try:
525+
mocker.patch("torch._logging._init_logs")
526+
except ModuleNotFoundError:
527+
# Allow running limited tests to run without freqAI dependencies
528+
pass
525529

526530

527531
@pytest.fixture(autouse=True)

0 commit comments

Comments
 (0)