From 8a52df4a8e8b6da9f514e843e6811433ce953522 Mon Sep 17 00:00:00 2001 From: Chris Coutinho Date: Sat, 25 Oct 2025 20:06:08 +0200 Subject: [PATCH] test: Skip unstructured tests if not enabled --- tests/integration/test_unstructured_api.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/integration/test_unstructured_api.py b/tests/integration/test_unstructured_api.py index 36d02b7..0e14ff3 100644 --- a/tests/integration/test_unstructured_api.py +++ b/tests/integration/test_unstructured_api.py @@ -2,6 +2,7 @@ import json import logging +import os import uuid from io import BytesIO @@ -37,7 +38,10 @@ def create_test_pdf(text: str) -> bytes: return buffer.getvalue() -@pytest.mark.integration +@pytest.mark.skipif( + condition=os.getenv("ENABLE_UNSTRUCTURED", "false") != "true", + reason="Unstructured is not enabled", +) async def test_unstructured_api_enabled_parsing( nc_client: NextcloudClient, test_base_path: str, nc_mcp_client: ClientSession ): @@ -97,7 +101,10 @@ async def test_unstructured_api_enabled_parsing( pass # Ignore cleanup errors -@pytest.mark.integration +@pytest.mark.skipif( + condition=os.getenv("ENABLE_UNSTRUCTURED", "false") != "true", + reason="Unstructured is not enabled", +) async def test_unstructured_api_with_docx( nc_client: NextcloudClient, test_base_path: str, nc_mcp_client: ClientSession ):