Skip to content

Commit 4bce8a7

Browse files
authored
Test the entry point (#27)
1 parent 3230b43 commit 4bce8a7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/test_plugin.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
import types
12
from pathlib import Path
23
from unittest.mock import Mock
34

45
import black
6+
import pkg_resources
57
import pytest
68
from pyls import uris
79
from pyls.workspace import Document, Workspace
@@ -202,3 +204,13 @@ def test_load_config_defaults():
202204
"fast": False,
203205
"skip_string_normalization": False,
204206
}
207+
208+
209+
def test_entry_point():
210+
distribution = pkg_resources.get_distribution("pyls-black")
211+
entry_point = distribution.get_entry_info("pyls", "pyls_black")
212+
213+
assert entry_point is not None
214+
215+
module = entry_point.load()
216+
assert isinstance(module, types.ModuleType)

0 commit comments

Comments
 (0)