Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions tests/test_plugin.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Standard library imports
import types
from pathlib import Path
import importlib.metadata
from unittest.mock import Mock

# Third-party imports
import black
import pkg_resources
import pytest

# Python LSP imports
Expand Down Expand Up @@ -321,13 +321,16 @@ def test_load_config_with_skip_options(config_with_skip_options):


def test_entry_point():
distribution = pkg_resources.get_distribution("python-lsp-black")
entry_point = distribution.get_entry_info("pylsp", "black")
entry_points_pylsp = importlib.metadata.entry_points(name="pylsp")
entry_points_black = importlib.metadata.entry_points(name="black")

assert entry_point is not None
assert entry_points_pylsp
assert entry_points_black

module = entry_point.load()
assert isinstance(module, types.ModuleType)
pylsp_entry = next(iter(entry_points_pylsp)).load()
black_entry = next(iter(entry_points_pylsp)).load()
assert isinstance(pylsp_entry, (types.ModuleType, types.FunctionType))
assert isinstance(black_entry, (types.ModuleType, types.FunctionType))


def test_pylsp_format_crlf_document(
Expand Down
Loading