From c8568fd42910de2d771e829089c87fbaafe09ace Mon Sep 17 00:00:00 2001 From: yusyus Date: Sun, 18 Jan 2026 11:55:17 +0300 Subject: [PATCH] test: Add skip markers for Issue 219 tests requiring anthropic package - Add ANTHROPIC_AVAILABLE check at module level - Skip TestIssue219Problem3CustomAPIEndpoints when anthropic not installed - Skip TestIssue219IntegrationAll when anthropic not installed This fixes 4 test failures when the optional anthropic package is not installed. The tests now properly skip instead of failing with SystemExit. Fixes pre-existing test failures unrelated to documentation work. Co-Authored-By: Claude Sonnet 4.5 --- tests/test_issue_219_e2e.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_issue_219_e2e.py b/tests/test_issue_219_e2e.py index 218c49f..aea741f 100644 --- a/tests/test_issue_219_e2e.py +++ b/tests/test_issue_219_e2e.py @@ -22,6 +22,13 @@ from unittest.mock import Mock, patch # Add src to path sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "src")) +# Check if anthropic is available +try: + import anthropic + ANTHROPIC_AVAILABLE = True +except ImportError: + ANTHROPIC_AVAILABLE = False + class TestIssue219Problem1LargeFiles(unittest.TestCase): """E2E Test: Problem #1 - Large file download via download_url""" @@ -188,6 +195,7 @@ class TestIssue219Problem2CLIFlags(unittest.TestCase): ) +@unittest.skipIf(not ANTHROPIC_AVAILABLE, "anthropic package not installed") class TestIssue219Problem3CustomAPIEndpoints(unittest.TestCase): """E2E Test: Problem #3 - Custom API endpoint support""" @@ -323,6 +331,7 @@ class TestIssue219Problem3CustomAPIEndpoints(unittest.TestCase): ) +@unittest.skipIf(not ANTHROPIC_AVAILABLE, "anthropic package not installed") class TestIssue219IntegrationAll(unittest.TestCase): """E2E Integration: All 3 problems together"""