Skip to content

Commit be852e4

Browse files
jeremymanningclaude
andcommitted
Fix torch import issue in test_automatic_gpu_parallelization.py
- Use pytest.importorskip() to conditionally import torch and numpy - This prevents ModuleNotFoundError during test collection in CI - Tests will be automatically skipped if dependencies aren't available - Resolves GitHub Actions failure due to missing torch dependency 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 02dadd3 commit be852e4

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tests/real_world/test_automatic_gpu_parallelization.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@
1010
"""
1111

1212
import pytest
13-
import torch
14-
import numpy as np
1513
from clustrix import cluster
1614
from clustrix.config import load_config, configure
1715
from tests.real_world import credentials
1816

17+
# Skip entire module if torch/numpy not available
18+
torch = pytest.importorskip("torch")
19+
np = pytest.importorskip("numpy")
20+
1921

2022
@pytest.mark.real_world
2123
class TestAutomaticGPUParallelization:

0 commit comments

Comments
 (0)