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 <noreply@anthropic.com>
This commit is contained in:
@@ -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"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user