Skip to content

Commit 4cdd2e8

Browse files
committed
mock open3d to avoid installation
1 parent aca5923 commit 4cdd2e8

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tests/test_test_animate.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,14 @@ def capture_screen_image(self, filepath):
5252
def destroy_window(self):
5353
pass
5454

55-
# Replace the o3d.visualization.Visualizer with our MockVisualizer
56-
# import open3d as o3d
57-
import open3d as o3d
55+
from unittest.mock import MagicMock
56+
57+
# Try importing Open3D, mock it if not available
58+
try:
59+
import open3d as o3d
60+
except ImportError:
61+
sys.modules["open3d"] = MagicMock()
62+
5863
o3d.utility.set_verbosity_level(o3d.utility.VerbosityLevel.Error)
5964

6065
o3d.visualization.Visualizer = MockVisualizer

0 commit comments

Comments
 (0)