33import pytest
44
55from lsp_client import LSPClient
6- from lsp_client .clients import local_clients
6+ from lsp_client .clients import (
7+ PyreflyClient ,
8+ PyrightClient ,
9+ RustAnalyzerClient ,
10+ TypescriptClient ,
11+ )
12+ from lsp_client .server .docker import DockerServer
713from lsp_client .utils .inspect import inspect_capabilities
814
915
1016@pytest .mark .asyncio
1117@pytest .mark .parametrize (
12- "client_cls" ,
13- local_clients ,
18+ "client_cls,image" ,
19+ [
20+ (PyrightClient , "ghcr.io/observerw/lsp-client/pyright:latest" ),
21+ (RustAnalyzerClient , "ghcr.io/observerw/lsp-client/rust-analyzer:latest" ),
22+ (TypescriptClient , "ghcr.io/observerw/lsp-client/typescript:latest" ),
23+ (PyreflyClient , "ghcr.io/observerw/lsp-client/pyrefly:latest" ),
24+ ],
1425)
15- async def test_capabilities_match (client_cls : type [LSPClient ]):
16- # instantiate the client directly to get its default server
17- client = client_cls ()
18- server = client .server
26+ async def test_capabilities_match (client_cls : type [LSPClient ], image : str ):
27+ # Use DockerServer for testing to ensure environment consistency
28+ server = DockerServer (image = image , mounts = [])
1929
2030 mismatches = []
2131 async for result in inspect_capabilities (server , client_cls ):
@@ -26,5 +36,6 @@ async def test_capabilities_match(client_cls: type[LSPClient]):
2636
2737 if mismatches :
2838 pytest .fail (
29- f"Capability mismatch for { client_cls .__name__ } :\n " + "\n " .join (mismatches )
39+ f"Capability mismatch for { client_cls .__name__ } in container { image } :\n "
40+ + "\n " .join (mismatches )
3041 )
0 commit comments