diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 20:18:22 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 20:18:22 +0000 |
commit | 1e5c28f36b0fd2d5ac1683c88d48e3d7c243e993 (patch) | |
tree | a81bb3938f710a181cb8cbb1ded2684711fab802 /tests/lsp_tests/conftest.py | |
parent | Adding upstream version 0.1.27.1. (diff) | |
download | debputy-1e5c28f36b0fd2d5ac1683c88d48e3d7c243e993.tar.xz debputy-1e5c28f36b0fd2d5ac1683c88d48e3d7c243e993.zip |
Adding upstream version 0.1.28.upstream/0.1.28
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/lsp_tests/conftest.py')
-rw-r--r-- | tests/lsp_tests/conftest.py | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/tests/lsp_tests/conftest.py b/tests/lsp_tests/conftest.py index ec12e9a..e995d88 100644 --- a/tests/lsp_tests/conftest.py +++ b/tests/lsp_tests/conftest.py @@ -1,5 +1,9 @@ import pytest +from debian.debian_support import DpkgArchTable +from debputy._deb_options_profiles import DebBuildOptionsAndProfiles +from debputy.architecture_support import DpkgArchitectureBuildProcessValuesTable +from debputy.packages import DctrlParser from debputy.plugin.api.feature_set import PluginProvidedFeatureSet from debputy.util import setup_logging @@ -17,7 +21,7 @@ try: HoverParams, MarkupContent, ) - from debputy.lsp.lsp_features import lsp_set_plugin_features + from debputy.lsp.debputy_ls import DebputyLanguageServer HAS_PYGLS = True except ImportError: @@ -29,13 +33,31 @@ def enable_logging() -> None: setup_logging(log_only_to_stderr=True, reconfigure_logging=True) +@pytest.fixture +def lsp_dctrl_parser( + dpkg_arch_query: DpkgArchTable, + amd64_dpkg_architecture_variables: DpkgArchitectureBuildProcessValuesTable, + no_profiles_or_build_options: DebBuildOptionsAndProfiles, +) -> DctrlParser: + return DctrlParser( + frozenset(), + frozenset(), + True, + True, + amd64_dpkg_architecture_variables, + dpkg_arch_query, + no_profiles_or_build_options, + ) + + @pytest.fixture() def ls( debputy_plugin_feature_set: PluginProvidedFeatureSet, -) -> "LanguageServer": + lsp_dctrl_parser: DctrlParser, +) -> "DebputyLanguageServer": if not HAS_PYGLS: pytest.skip("Missing pygls") - ls = LanguageServer("debputy", "v<test>") + ls = DebputyLanguageServer("debputy", "v<test>") ls.lsp.lsp_initialize( InitializeParams( ClientCapabilities( @@ -45,8 +67,6 @@ def ls( ) ) ) - lsp_set_plugin_features(debputy_plugin_feature_set) - try: - yield ls - finally: - lsp_set_plugin_features(None) + ls.plugin_feature_set = debputy_plugin_feature_set + ls.dctrl_parser = lsp_dctrl_parser + return ls |