fix: skip tests when atroposlib/minisweagent unavailable in CI
- test_agent_loop_tool_calling.py: import atroposlib at module level to trigger skip (environments.agent_loop is now importable without atroposlib due to __init__.py graceful fallback) - test_modal_sandbox_fixes.py: skip TestToolResolution tests when minisweagent not installed
This commit is contained in:
parent
d198a647e2
commit
59b53f0a23
2 changed files with 12 additions and 0 deletions
|
|
@ -35,6 +35,7 @@ if str(_repo_root) not in sys.path:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from environments.agent_loop import AgentResult, HermesAgentLoop
|
from environments.agent_loop import AgentResult, HermesAgentLoop
|
||||||
|
from atroposlib.envs.server_handling.openai_server import OpenAIServer # noqa: F401
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pytest.skip("atroposlib not installed", allow_module_level=True)
|
pytest.skip("atroposlib not installed", allow_module_level=True)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,8 +36,17 @@ except ImportError:
|
||||||
class TestToolResolution:
|
class TestToolResolution:
|
||||||
"""Verify get_tool_definitions returns all expected tools for eval."""
|
"""Verify get_tool_definitions returns all expected tools for eval."""
|
||||||
|
|
||||||
|
def _has_minisweagent(self):
|
||||||
|
try:
|
||||||
|
import minisweagent # noqa: F401
|
||||||
|
return True
|
||||||
|
except ImportError:
|
||||||
|
return False
|
||||||
|
|
||||||
def test_terminal_and_file_toolsets_resolve_all_tools(self):
|
def test_terminal_and_file_toolsets_resolve_all_tools(self):
|
||||||
"""enabled_toolsets=['terminal', 'file'] should produce 6 tools."""
|
"""enabled_toolsets=['terminal', 'file'] should produce 6 tools."""
|
||||||
|
if not self._has_minisweagent():
|
||||||
|
pytest.skip("minisweagent not installed (git submodule update --init)")
|
||||||
from model_tools import get_tool_definitions
|
from model_tools import get_tool_definitions
|
||||||
tools = get_tool_definitions(
|
tools = get_tool_definitions(
|
||||||
enabled_toolsets=["terminal", "file"],
|
enabled_toolsets=["terminal", "file"],
|
||||||
|
|
@ -49,6 +58,8 @@ class TestToolResolution:
|
||||||
|
|
||||||
def test_terminal_tool_present(self):
|
def test_terminal_tool_present(self):
|
||||||
"""The terminal tool must be present (not silently dropped)."""
|
"""The terminal tool must be present (not silently dropped)."""
|
||||||
|
if not self._has_minisweagent():
|
||||||
|
pytest.skip("minisweagent not installed (git submodule update --init)")
|
||||||
from model_tools import get_tool_definitions
|
from model_tools import get_tool_definitions
|
||||||
tools = get_tool_definitions(
|
tools = get_tool_definitions(
|
||||||
enabled_toolsets=["terminal", "file"],
|
enabled_toolsets=["terminal", "file"],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue