Skip to content

Commit 54aa7a9

Browse files
authored
chore: skip markitdown test if dependency not available (#3310)
1 parent c971fbc commit 54aa7a9

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

test/loaders/test_markitdown.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,21 @@
1717

1818
import pytest
1919

20-
from camel.loaders import MarkItDownLoader
20+
# Try importing markitdown, skip tests if not available
21+
try:
22+
import markitdown # noqa: F401
23+
24+
from camel.loaders import MarkItDownLoader
25+
26+
markitdown_available = True
27+
except ImportError:
28+
markitdown_available = False
29+
30+
# Skip all tests in this module if markitdown isn't available
31+
pytestmark = pytest.mark.skipif(
32+
not markitdown_available,
33+
reason="markitdown is not installed (only available for Python >= 3.13)",
34+
)
2135

2236

2337
@pytest.fixture

0 commit comments

Comments
 (0)