Skip to content

Commit ec076b3

Browse files
committed
Fix Windows path comparison in test
Use Path objects for comparison instead of string contains check to avoid issues with backslash escaping on Windows.
1 parent 2213a59 commit ec076b3

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

tests/test_audio_player.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,11 @@ def test_sound_lib_play_creates_stream(self):
197197

198198
# Verify FileStream was created with correct path
199199
mock_stream_module.FileStream.assert_called_once()
200-
call_kwargs = mock_stream_module.FileStream.call_args
201-
assert temp_path in str(call_kwargs)
200+
call_args = mock_stream_module.FileStream.call_args
201+
# Check if temp_path was passed as positional or keyword arg
202+
passed_path = call_args.kwargs.get("file") or (call_args.args[0] if call_args.args else None)
203+
assert passed_path is not None
204+
assert str(Path(passed_path)) == str(Path(temp_path))
202205

203206
# Verify play was called
204207
mock_file_stream.play.assert_called_once()

0 commit comments

Comments
 (0)