Skip to content

Commit aedb472

Browse files
authored
chore: automatically mark lsp tests as fast (#4665)
1 parent 80b68b7 commit aedb472

File tree

6 files changed

+4
-16
lines changed

6 files changed

+4
-16
lines changed

tests/lsp/conftest.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import pytest
2+
3+
# Apply the 'fast' mark to all tests in this directory and subdirectories
4+
pytestmark = pytest.mark.fast

tests/lsp/test_completions.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import pytest
21
from sqlglot import Tokenizer
32
from sqlmesh.core.context import Context
43
from sqlmesh.lsp.completions import get_keywords_from_tokenizer, get_sql_completions
@@ -9,19 +8,16 @@
98
TOKENIZER_KEYWORDS = set(Tokenizer.KEYWORDS.keys())
109

1110

12-
@pytest.mark.fast
1311
def test_get_keywords_from_tokenizer():
1412
assert len(get_keywords_from_tokenizer()) >= len(TOKENIZER_KEYWORDS)
1513

1614

17-
@pytest.mark.fast
1815
def test_get_sql_completions_no_context():
1916
completions = get_sql_completions(None, None)
2017
assert len(completions.keywords) >= len(TOKENIZER_KEYWORDS)
2118
assert len(completions.models) == 0
2219

2320

24-
@pytest.mark.fast
2521
def test_get_sql_completions_with_context_no_file_uri():
2622
context = Context(paths=["examples/sushi"])
2723
lsp_context = LSPContext(context)
@@ -32,7 +28,6 @@ def test_get_sql_completions_with_context_no_file_uri():
3228
assert "sushi.customers" in completions.models
3329

3430

35-
@pytest.mark.fast
3631
def test_get_sql_completions_with_context_and_file_uri():
3732
context = Context(paths=["examples/sushi"])
3833
lsp_context = LSPContext(context)

tests/lsp/test_context.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
import pytest
21
from sqlmesh.core.context import Context
32
from sqlmesh.lsp.context import LSPContext, ModelTarget
43

54

6-
@pytest.mark.fast
75
def test_lsp_context():
86
context = Context(paths=["examples/sushi"])
97
lsp_context = LSPContext(context)

tests/lsp/test_reference.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
import pytest
21
from lsprotocol.types import Position
32
from sqlmesh.core.context import Context
43
from sqlmesh.lsp.context import LSPContext, ModelTarget, AuditTarget
54
from sqlmesh.lsp.reference import get_model_definitions_for_a_path, by_position
65
from sqlmesh.lsp.uri import URI
76

87

9-
@pytest.mark.fast
108
def test_reference() -> None:
119
context = Context(paths=["examples/sushi"])
1210
lsp_context = LSPContext(context)
@@ -39,7 +37,6 @@ def test_reference() -> None:
3937
assert referenced_text == "sushi.customers"
4038

4139

42-
@pytest.mark.fast
4340
def test_reference_with_alias() -> None:
4441
context = Context(paths=["examples/sushi"])
4542
lsp_context = LSPContext(context)
@@ -79,7 +76,6 @@ def test_reference_with_alias() -> None:
7976
assert get_string_from_range(read_file, references[2].range) == "sushi.items"
8077

8178

82-
@pytest.mark.fast
8379
def test_standalone_audit_reference() -> None:
8480
context = Context(paths=["examples/sushi"])
8581
lsp_context = LSPContext(context)
@@ -129,7 +125,6 @@ def get_string_from_range(file_lines, range_obj) -> str:
129125
return result
130126

131127

132-
@pytest.mark.fast
133128
def test_filter_references_by_position() -> None:
134129
"""Test that we can filter references correctly based on cursor position."""
135130
context = Context(paths=["examples/sushi"])

tests/lsp/test_reference_macro.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
import pytest
21
from sqlmesh.core.context import Context
32
from sqlmesh.lsp.context import LSPContext, ModelTarget
43
from sqlmesh.lsp.reference import get_macro_definitions_for_a_path
54
from sqlmesh.lsp.uri import URI
65

76

8-
@pytest.mark.fast
97
def test_macro_references() -> None:
108
"""Test that macro references (e.g., @ADD_ONE, @MULTIPLY) have proper go-to-definition support."""
119
context = Context(paths=["examples/sushi"])

tests/lsp/test_reference_macro_multi.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
import pytest
21
from sqlmesh.core.context import Context
32
from sqlmesh.lsp.context import LSPContext, ModelTarget
43
from sqlmesh.lsp.reference import get_macro_definitions_for_a_path
54
from sqlmesh.lsp.uri import URI
65

76

8-
@pytest.mark.fast
97
def test_macro_references_multirepo() -> None:
108
context = Context(paths=["examples/multi/repo_1", "examples/multi/repo_2"], gateway="memory")
119
lsp_context = LSPContext(context)

0 commit comments

Comments
 (0)