File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ from __future__ import annotations
2+
3+ import pytest
4+
5+ from lsp_client import LSPClient
6+ from lsp_client .clients import local_clients
7+ from lsp_client .utils .inspect import inspect_capabilities
8+
9+
10+ @pytest .mark .asyncio
11+ @pytest .mark .parametrize (
12+ "client_cls" ,
13+ local_clients ,
14+ )
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
19+
20+ mismatches = []
21+ async for result in inspect_capabilities (server , client_cls ):
22+ if result .client != result .server :
23+ mismatches .append (
24+ f"{ result .capability } : client={ result .client } , server={ result .server } "
25+ )
26+
27+ if mismatches :
28+ pytest .fail (
29+ f"Capability mismatch for { client_cls .__name__ } :\n " + "\n " .join (mismatches )
30+ )
You can’t perform that action at this time.
0 commit comments