summaryrefslogtreecommitdiffstats
path: root/tests/lint_tests/conftest.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 20:18:23 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 20:18:23 +0000
commit11180d7be49c1912b7bdcba23d932747041e5b5d (patch)
tree3077ae4439be0c59d739cab309eb017334850822 /tests/lint_tests/conftest.py
parentReleasing progress-linux version 0.1.27.1-0.0~progress7.99u1. (diff)
downloaddebputy-11180d7be49c1912b7bdcba23d932747041e5b5d.tar.xz
debputy-11180d7be49c1912b7bdcba23d932747041e5b5d.zip
Merging upstream version 0.1.28.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/lint_tests/conftest.py')
-rw-r--r--tests/lint_tests/conftest.py41
1 files changed, 30 insertions, 11 deletions
diff --git a/tests/lint_tests/conftest.py b/tests/lint_tests/conftest.py
index d08f5ca..2c54eb7 100644
--- a/tests/lint_tests/conftest.py
+++ b/tests/lint_tests/conftest.py
@@ -1,16 +1,22 @@
import pytest
+from debian.debian_support import DpkgArchTable
-from debputy.lsp.lsp_features import lsp_set_plugin_features
-from debputy.plugin.api.feature_set import PluginProvidedFeatureSet
+from debputy._deb_options_profiles import DebBuildOptionsAndProfiles
+from debputy.architecture_support import DpkgArchitectureBuildProcessValuesTable
+from debputy.packages import DctrlParser
from debputy.util import setup_logging
try:
from lsprotocol.types import Diagnostic
+ from debputy.lsp.spellchecking import disable_spellchecking
HAS_LSPROTOCOL = True
except ImportError:
HAS_LSPROTOCOL = False
+ def disable_spellchecking() -> None:
+ pass
+
@pytest.fixture(scope="session", autouse=True)
def enable_logging() -> None:
@@ -19,12 +25,25 @@ def enable_logging() -> None:
setup_logging(reconfigure_logging=True)
-@pytest.fixture(autouse=True)
-def setup_feature_set(
- debputy_plugin_feature_set: PluginProvidedFeatureSet,
-) -> None:
- lsp_set_plugin_features(debputy_plugin_feature_set)
- try:
- yield
- finally:
- lsp_set_plugin_features(None)
+@pytest.fixture(scope="session", autouse=True)
+def disable_spellchecking_fixture() -> None:
+ # CI/The buildd does not install relevant, so this is mostly about ensuring
+ # consistent behavior between clean and "unclean" build/test environments
+ disable_spellchecking()
+
+
+@pytest.fixture
+def lint_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,
+ )