Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions tests/test_multilang.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,22 @@
from pathlib import Path

import pytest
import tree_sitter_language_pack as tslp

from code_review_graph.parser import CodeParser

FIXTURES = Path(__file__).parent / "fixtures"


@pytest.fixture(scope="class")
def lua_available():
try:
tslp.get_parser("lua")
return True
except Exception:
return False


class TestGoParsing:
def setup_method(self):
self.parser = CodeParser()
Expand Down Expand Up @@ -688,6 +698,11 @@ def test_finds_contains(self):


class TestLuaParsing:
@pytest.fixture(autouse=True)
def check_lua_available(self, lua_available):
if not lua_available:
pytest.skip("Lua grammar not available (blocked by Application Control policy)")

def setup_method(self):
self.parser = CodeParser()
self.nodes, self.edges = self.parser.parse_file(FIXTURES / "sample.lua")
Expand Down
Loading