Skip to content

Graph-Native Infrastructure for Context and Accountable AI Systems

test: guard lxml, GitPython and google-adk imports so collection succeeds on a clean [dev] install

dex0shubhame4e28c31de45
diff --git a/tests/ingest/test_notebook_02.py b/tests/ingest/test_notebook_02.py
index f99a8b37..5a2d4ada 100644
--- a/tests/ingest/test_notebook_02.py
+++ b/tests/ingest/test_notebook_02.py
@@ -12,7 +12,6 @@ from semantica.ingest import (
WebIngestor, ContentExtractor, SitemapCrawler, RobotsChecker,
FeedIngestor, FeedMonitor,
StreamIngestor, StreamMonitor,
- RepoIngestor, CodeExtractor, GitAnalyzer,
EmailIngestor, AttachmentProcessor,
DBIngestor, DatabaseConnector,
MCPIngestor, IngestConfig, ingest_config
@@ -140,6 +139,9 @@ class TestNotebook02DataIngestion:
assert 'overall' in health
def test_06_repo_ingestion(self):
+ pytest.importorskip("git")
+ from semantica.ingest import CodeExtractor, RepoIngestor
+
code_extractor = CodeExtractor()
with tempfile.NamedTemporaryFile(mode="w", suffix=".py", delete=False) as tmp:
tmp.write("class MyClass:\n def my_method(self):\n pass")
diff --git a/tests/ingest/test_xml_ingestor.py b/tests/ingest/test_xml_ingestor.py
index 5b197a0d..c6327bf9 100644
--- a/tests/ingest/test_xml_ingestor.py
+++ b/tests/ingest/test_xml_ingestor.py
@@ -2,15 +2,17 @@ from pathlib import Path
import pytest
-from semantica.ingest import (
+pytest.importorskip("lxml")
+
+from semantica.ingest import ( # noqa: E402
XMLIngestionData,
XMLIngestor,
ingest,
ingest_file,
ingest_xml,
)
-from semantica.ingest.xml_ingestor import XML_NAMESPACE
-from semantica.utils.exceptions import ProcessingError, ValidationError
+from semantica.ingest.xml_ingestor import XML_NAMESPACE # noqa: E402
+from semantica.utils.exceptions import ProcessingError, ValidationError # noqa: E402
def test_xml_ingestor_extracts_structure_namespaces_and_attributes(
diff --git a/tests/integrations/google_adk/test_shared_graph.py b/tests/integrations/google_adk/test_shared_graph.py
index 584a5dbb..c4f3cf97 100644
--- a/tests/integrations/google_adk/test_shared_graph.py
+++ b/tests/integrations/google_adk/test_shared_graph.py
@@ -13,8 +13,6 @@ def require_adk(request):
pytest.importorskip("google.adk")
-from google.adk.events import Event
-
from integrations.google_adk import (
SemanticaSessionService,
semantica_decision_tools,
@@ -115,6 +113,8 @@ def test_shared_graph_event_and_knowledge_nodes():
)
)
+ from google.adk.events import Event
+
event = Event(
author="researcher",
invocation_id="shared-invocation",