Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

test: handle Windows executable casing in ty LSP test (#11329)

Trevor Manz86ef6395dccb
diff --git a/tests/_server/test_lsp.py b/tests/_server/test_lsp.py
index a10cb07d16..f3a9ed7a49 100644
--- a/tests/_server/test_lsp.py
+++ b/tests/_server/test_lsp.py
@@ -1,6 +1,7 @@
from __future__ import annotations
import signal
+from pathlib import Path
from typing import TYPE_CHECKING, Literal
from unittest import mock
@@ -32,7 +33,6 @@ from marimo._utils.platform import is_windows
if TYPE_CHECKING:
from collections.abc import Iterator
- from pathlib import Path
@pytest.fixture
@@ -740,7 +740,10 @@ async def test_ty_server_starts_with_binary_on_path(
assert await server.start() is None
mock_popen.assert_called_once()
command = mock_popen.call_args.args[0]
- assert command[command.index("--lsp") + 1] == f"ty:{binary}"
+ lsp_command = command[command.index("--lsp") + 1]
+ server_type, _, executable = lsp_command.partition(":")
+ assert server_type == "ty"
+ assert Path(executable) == binary
finally:
server.stop()