fix: stub cv2 in tests to prevent timeout under pytest-xdist
Some checks failed
Tests / lint (pull_request) Failing after 31s
Tests / test (pull_request) Has been skipped

Add 'cv2' to the list of stubbed modules in conftest.py to prevent
OpenCV import from hanging under pytest-xdist parallel workers.

The perception_cache.py module imports cv2 at the module level, which
can cause deadlocks/hangs when running tests in parallel with pytest-xdist.
By stubbing cv2 in conftest.py, tests get a MagicMock instead of the
real cv2, avoiding the import hang.

Fixes #1336
This commit is contained in:
kimi
2026-03-23 22:57:12 -04:00
parent 9e8e0f8552
commit 1356172642

View File

@@ -33,6 +33,7 @@ for _mod in [
"sentence_transformers",
"swarm",
"swarm.event_log",
"cv2", # OpenCV import can hang under pytest-xdist parallel workers
]:
sys.modules.setdefault(_mod, MagicMock())