From 4516219239647d7c37dff99141e6b6884e44a341 Mon Sep 17 00:00:00 2001 From: Alex Carney Date: Thu, 31 Aug 2023 20:19:13 +0100 Subject: [PATCH] pytest-lsp: Align to upstream renames --- lib/pytest-lsp/pytest_lsp/client.py | 2 +- lib/pytest-lsp/pytest_lsp/plugin.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/pytest-lsp/pytest_lsp/client.py b/lib/pytest-lsp/pytest_lsp/client.py index 1049ee0..6eabb3c 100644 --- a/lib/pytest-lsp/pytest_lsp/client.py +++ b/lib/pytest-lsp/pytest_lsp/client.py @@ -24,7 +24,7 @@ from lsprotocol.types import ShowDocumentParams from lsprotocol.types import ShowDocumentResult from lsprotocol.types import ShowMessageParams -from pygls.lsp.client import LanguageClient as BaseLanguageClient +from pygls.lsp.client import BaseLanguageClient from pygls.protocol import default_converter from .protocol import LanguageClientProtocol diff --git a/lib/pytest-lsp/pytest_lsp/plugin.py b/lib/pytest-lsp/pytest_lsp/plugin.py index 4278757..82328cf 100644 --- a/lib/pytest-lsp/pytest_lsp/plugin.py +++ b/lib/pytest-lsp/pytest_lsp/plugin.py @@ -11,7 +11,7 @@ import attrs import pytest import pytest_asyncio -from pygls.client import Client +from pygls.client import JsonRPCClient from pytest_lsp.client import LanguageClient from pytest_lsp.client import make_test_lsp_client @@ -26,7 +26,7 @@ class ClientServerConfig: server_command: List[str] """The command to use to start the language server.""" - client_factory: Callable[[], Client] = attrs.field( + client_factory: Callable[[], JsonRPCClient] = attrs.field( default=make_test_lsp_client, ) """Factory function to use when constructing the test client instance.""" @@ -34,7 +34,7 @@ class ClientServerConfig: server_env: Optional[Dict[str, str]] = attrs.field(default=None) """Environment variables to set when starting the server.""" - async def start(self) -> Client: + async def start(self) -> JsonRPCClient: """Return the client instance to use for the test.""" client = self.client_factory() @@ -83,7 +83,7 @@ async def anext(it): def get_fixture_arguments( fn: Callable, - client: Client, + client: JsonRPCClient, request: pytest.FixtureRequest, ) -> dict: """Return the arguments to pass to the user's fixture function. @@ -114,7 +114,7 @@ def get_fixture_arguments( # Inject the language client for name, cls in typing.get_type_hints(fn).items(): - if issubclass(cls, Client): + if issubclass(cls, JsonRPCClient): kwargs[name] = client required_parameters.remove(name)