Skip to content

Commit

Permalink
pytest-lsp: Align to upstream renames
Browse files Browse the repository at this point in the history
  • Loading branch information
alcarney committed Sep 8, 2023
1 parent 58fe14d commit f0dc264
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/pytest-lsp/pytest_lsp/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions lib/pytest-lsp/pytest_lsp/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -26,15 +26,15 @@ 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."""

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()

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit f0dc264

Please sign in to comment.