@@ -111,9 +111,14 @@ def test_build_menu_with_mounts(self, tray_app, fake_pystray):
111111 assert menu .items [0 ].text == "D: - image.hdf"
112112
113113 def test_build_menu_mount_label_format (self , tray_app , fake_pystray ):
114- """Label format is 'D: - image.hdf'."""
114+ """Label format is 'E: - work.adf'."""
115+ # Use a platform-appropriate path so Path().name extracts just the filename
116+ if sys .platform == "win32" :
117+ image_path = "C:\\ disks\\ work.adf"
118+ else :
119+ image_path = "/disks/work.adf"
115120 tray_app ._mounts = [
116- {"pid" : 100 , "mountpoint" : "E:" , "image" : "C: \\ disks \\ work.adf" },
121+ {"pid" : 100 , "mountpoint" : "E:" , "image" : image_path },
117122 ]
118123 menu = tray_app ._build_menu ()
119124 assert menu .items [0 ].text == "E: - work.adf"
@@ -289,6 +294,7 @@ def fake_find():
289294# ---------------------------------------------------------------------------
290295
291296
297+ @pytest .mark .skipif (sys .platform != "win32" , reason = "Windows-only: ctypes.windll" )
292298class TestSingleInstance :
293299 def test_single_instance_acquired (self , monkeypatch ):
294300 """CreateMutexW succeeds, GetLastError != 183."""
@@ -519,6 +525,7 @@ def test_mount_label_uses_image_key(self, tray_app, fake_pystray):
519525 assert "game.hdf" in mount_label
520526
521527
528+ @pytest .mark .skipif (sys .platform != "win32" , reason = "Windows-only: pythonw.exe logic" )
522529class TestInspectUsesPythonExe :
523530 def test_inspect_uses_python_exe (self , tray_app , fake_pystray , monkeypatch ):
524531 """Inspect resolves python.exe not pythonw.exe/sys.executable."""
0 commit comments