summaryrefslogtreecommitdiffstats
path: root/tests/lint_tests/conftest.py
diff options
context:
space:
mode:
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,
+ )