summaryrefslogtreecommitdiffstats
path: root/tests/lint_tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lint_tests')
-rw-r--r--tests/lint_tests/conftest.py13
-rw-r--r--tests/lint_tests/lint_tutil.py5
-rw-r--r--tests/lint_tests/test_lint_changelog.py5
-rw-r--r--tests/lint_tests/test_lint_dcpy.py5
-rw-r--r--tests/lint_tests/test_lint_dctrl.py5
-rw-r--r--tests/lint_tests/test_lint_debputy.py5
-rw-r--r--tests/lint_tests/test_lint_dtctrl.py6
7 files changed, 13 insertions, 31 deletions
diff --git a/tests/lint_tests/conftest.py b/tests/lint_tests/conftest.py
index bf4b3b0..e364bbc 100644
--- a/tests/lint_tests/conftest.py
+++ b/tests/lint_tests/conftest.py
@@ -3,22 +3,25 @@ from debian.debian_support import DpkgArchTable
from debputy._deb_options_profiles import DebBuildOptionsAndProfiles
from debputy.architecture_support import DpkgArchitectureBuildProcessValuesTable
-from debputy.lsp.style_prefs import StylePreferenceTable
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
+try:
+ from lsprotocol import types
+except ImportError:
+ HAS_LSPROTOCOL = False
+else:
+ HAS_LSPROTOCOL = True
+
+
@pytest.fixture(scope="session", autouse=True)
def enable_logging() -> None:
if not HAS_LSPROTOCOL:
diff --git a/tests/lint_tests/lint_tutil.py b/tests/lint_tests/lint_tutil.py
index 65fe0ad..267f669 100644
--- a/tests/lint_tests/lint_tutil.py
+++ b/tests/lint_tests/lint_tutil.py
@@ -13,10 +13,7 @@ from debputy.lsp.style_prefs import StylePreferenceTable, EffectivePreference
from debputy.packages import DctrlParser
from debputy.plugin.api.feature_set import PluginProvidedFeatureSet
-try:
- from lsprotocol.types import Diagnostic, DiagnosticSeverity
-except ImportError:
- pass
+from debputy.lsprotocol.types import Diagnostic, DiagnosticSeverity
try:
diff --git a/tests/lint_tests/test_lint_changelog.py b/tests/lint_tests/test_lint_changelog.py
index b5ab69e..2e48b82 100644
--- a/tests/lint_tests/test_lint_changelog.py
+++ b/tests/lint_tests/test_lint_changelog.py
@@ -7,10 +7,7 @@ from debputy.packages import DctrlParser
from debputy.plugin.api.feature_set import PluginProvidedFeatureSet
from lint_tests.lint_tutil import LintWrapper
-try:
- from lsprotocol.types import Diagnostic, DiagnosticSeverity
-except ImportError:
- pass
+from debputy.lsprotocol.types import DiagnosticSeverity
@pytest.fixture
diff --git a/tests/lint_tests/test_lint_dcpy.py b/tests/lint_tests/test_lint_dcpy.py
index f827d3e..9b89b67 100644
--- a/tests/lint_tests/test_lint_dcpy.py
+++ b/tests/lint_tests/test_lint_dcpy.py
@@ -10,10 +10,7 @@ from lint_tests.lint_tutil import (
LintWrapper,
)
-try:
- from lsprotocol.types import Diagnostic, DiagnosticSeverity
-except ImportError:
- pass
+from debputy.lsprotocol.types import DiagnosticSeverity
@pytest.fixture
diff --git a/tests/lint_tests/test_lint_dctrl.py b/tests/lint_tests/test_lint_dctrl.py
index 7478461..6479886 100644
--- a/tests/lint_tests/test_lint_dctrl.py
+++ b/tests/lint_tests/test_lint_dctrl.py
@@ -13,10 +13,7 @@ from lint_tests.lint_tutil import (
LintWrapper,
)
-try:
- from lsprotocol.types import Diagnostic, DiagnosticSeverity
-except ImportError:
- pass
+from debputy.lsprotocol.types import Diagnostic, DiagnosticSeverity
class DctrlLintWrapper(LintWrapper):
diff --git a/tests/lint_tests/test_lint_debputy.py b/tests/lint_tests/test_lint_debputy.py
index 28dab00..2af34ae 100644
--- a/tests/lint_tests/test_lint_debputy.py
+++ b/tests/lint_tests/test_lint_debputy.py
@@ -11,10 +11,7 @@ from lint_tests.lint_tutil import (
group_diagnostics_by_severity,
)
-try:
- from lsprotocol.types import Diagnostic, DiagnosticSeverity
-except ImportError:
- pass
+from debputy.lsprotocol.types import DiagnosticSeverity
@pytest.fixture
diff --git a/tests/lint_tests/test_lint_dtctrl.py b/tests/lint_tests/test_lint_dtctrl.py
index 6127dd9..9b58076 100644
--- a/tests/lint_tests/test_lint_dtctrl.py
+++ b/tests/lint_tests/test_lint_dtctrl.py
@@ -7,16 +7,10 @@ from debputy.lsp.lsp_debian_tests_control import _lint_debian_tests_control
from debputy.packages import DctrlParser
from debputy.plugin.api.feature_set import PluginProvidedFeatureSet
from lint_tests.lint_tutil import (
- group_diagnostics_by_severity,
requires_levenshtein,
LintWrapper,
)
-try:
- from lsprotocol.types import Diagnostic, DiagnosticSeverity
-except ImportError:
- pass
-
@pytest.fixture
def line_linter(