Skip to content

Commit b6e892e

Browse files
committed
Fix review issue #3: Move sys.path.insert to top of conftest.py before pygame setup
1 parent b9d26c5 commit b6e892e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tests/conftest.py

100644100755
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
import os
33
from unittest.mock import MagicMock
44

5+
# Add repo root to sys.path before any game module imports are attempted
6+
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
7+
58
# Set dummy SDL drivers so pygame.init() doesn't error on headless/audio-less systems
69
os.environ.setdefault("SDL_VIDEODRIVER", "dummy")
710
os.environ.setdefault("SDL_AUDIODRIVER", "dummy")
@@ -12,6 +15,3 @@
1215
# Patch mixer before game is imported so Game.__init__ doesn't need real audio hardware
1316
pygame.mixer.Sound = MagicMock(return_value=MagicMock())
1417
pygame.mixer.music = MagicMock()
15-
16-
# Add repo root to sys.path so all source modules are importable
17-
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))

0 commit comments

Comments
 (0)