We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b9d26c5 commit b6e892eCopy full SHA for b6e892e
1 file changed
tests/conftest.py
100644
100755
@@ -2,6 +2,9 @@
2
import os
3
from unittest.mock import MagicMock
4
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
+
8
# Set dummy SDL drivers so pygame.init() doesn't error on headless/audio-less systems
9
os.environ.setdefault("SDL_VIDEODRIVER", "dummy")
10
os.environ.setdefault("SDL_AUDIODRIVER", "dummy")
@@ -12,6 +15,3 @@
12
15
# Patch mixer before game is imported so Game.__init__ doesn't need real audio hardware
13
16
pygame.mixer.Sound = MagicMock(return_value=MagicMock())
14
17
pygame.mixer.music = MagicMock()
-
-# Add repo root to sys.path so all source modules are importable
-sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
0 commit comments