VibecoderMcSwaggins commited on
Commit
4e785f8
·
1 Parent(s): a805769

fix: skip Modal integration tests when package not installed

Browse files

The test was only checking for Modal credentials but not whether
the modal package itself was installed, causing test failures in
environments without the optional dependency.

Files changed (1) hide show
  1. tests/integration/test_modal.py +11 -2
tests/integration/test_modal.py CHANGED
@@ -1,4 +1,4 @@
1
- """Integration tests for Modal (requires credentials)."""
2
 
3
  import pytest
4
 
@@ -7,9 +7,18 @@ from src.utils.config import settings
7
  # Check if any LLM API key is available
8
  _llm_available = bool(settings.openai_api_key or settings.anthropic_api_key)
9
 
 
 
 
 
 
 
 
 
10
 
11
  @pytest.mark.integration
12
- @pytest.mark.skipif(not settings.modal_available, reason="Modal not configured")
 
13
  class TestModalIntegration:
14
  """Integration tests requiring Modal credentials."""
15
 
 
1
+ """Integration tests for Modal (requires credentials and modal package)."""
2
 
3
  import pytest
4
 
 
7
  # Check if any LLM API key is available
8
  _llm_available = bool(settings.openai_api_key or settings.anthropic_api_key)
9
 
10
+ # Check if modal package is installed
11
+ try:
12
+ import modal # noqa: F401
13
+
14
+ _modal_installed = True
15
+ except ImportError:
16
+ _modal_installed = False
17
+
18
 
19
  @pytest.mark.integration
20
+ @pytest.mark.skipif(not _modal_installed, reason="Modal package not installed")
21
+ @pytest.mark.skipif(not settings.modal_available, reason="Modal credentials not configured")
22
  class TestModalIntegration:
23
  """Integration tests requiring Modal credentials."""
24