test: skip atropos-dependent tests when atroposlib not installed
Guard all test files that import from environments/ or atroposlib with try/except + pytest.skip(allow_module_level=True) so they gracefully skip instead of crashing when deps aren't available.
This commit is contained in:
parent
366de72a38
commit
0f53275169
3 changed files with 13 additions and 4 deletions
|
|
@ -33,7 +33,10 @@ _repo_root = Path(__file__).resolve().parent.parent
|
||||||
if str(_repo_root) not in sys.path:
|
if str(_repo_root) not in sys.path:
|
||||||
sys.path.insert(0, str(_repo_root))
|
sys.path.insert(0, str(_repo_root))
|
||||||
|
|
||||||
from environments.agent_loop import AgentResult, HermesAgentLoop
|
try:
|
||||||
|
from environments.agent_loop import AgentResult, HermesAgentLoop
|
||||||
|
except ImportError:
|
||||||
|
pytest.skip("atroposlib not installed", allow_module_level=True)
|
||||||
|
|
||||||
|
|
||||||
# =========================================================================
|
# =========================================================================
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,10 @@ _repo_root = Path(__file__).resolve().parent.parent
|
||||||
if str(_repo_root) not in sys.path:
|
if str(_repo_root) not in sys.path:
|
||||||
sys.path.insert(0, str(_repo_root))
|
sys.path.insert(0, str(_repo_root))
|
||||||
|
|
||||||
from environments.agent_loop import AgentResult, HermesAgentLoop
|
try:
|
||||||
|
from environments.agent_loop import AgentResult, HermesAgentLoop
|
||||||
|
except ImportError:
|
||||||
|
pytest.skip("atroposlib not installed", allow_module_level=True)
|
||||||
|
|
||||||
|
|
||||||
# =========================================================================
|
# =========================================================================
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,11 @@ _repo_root = Path(__file__).resolve().parent.parent.parent
|
||||||
if str(_repo_root) not in sys.path:
|
if str(_repo_root) not in sys.path:
|
||||||
sys.path.insert(0, str(_repo_root))
|
sys.path.insert(0, str(_repo_root))
|
||||||
|
|
||||||
import tools.terminal_tool # noqa: F401
|
try:
|
||||||
_tt_mod = sys.modules["tools.terminal_tool"]
|
import tools.terminal_tool # noqa: F401
|
||||||
|
_tt_mod = sys.modules["tools.terminal_tool"]
|
||||||
|
except ImportError:
|
||||||
|
pytest.skip("hermes-agent tools not importable (missing deps)", allow_module_level=True)
|
||||||
|
|
||||||
|
|
||||||
# =========================================================================
|
# =========================================================================
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue