forked from amd/skills
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
28 lines (20 loc) · 891 Bytes
/
Copy pathconftest.py
File metadata and controls
28 lines (20 loc) · 891 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"""pytest wiring for the behavioral harness.
Adds this directory to ``sys.path`` so tests can ``from harness import ...``,
and runs a one-time API preflight so the (expensive) behavioral runs fail
fast with a clear message when the `claude` API isn't reachable -- e.g.
when you're not connected to the network that can reach it.
"""
from __future__ import annotations
import sys
from pathlib import Path
import pytest
sys.path.insert(0, str(Path(__file__).resolve().parent))
from harness import DEFAULT_MODEL, check_api_reachable # noqa: E402
@pytest.fixture(scope="session", autouse=True)
def _require_api_reachable() -> None:
"""Fail the suite up front if the `claude` API can't be reached."""
ok, detail = check_api_reachable(DEFAULT_MODEL)
if not ok:
pytest.fail(
f"claude API not reachable -- are you on the right network? ({detail})"
)