-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
32 lines (24 loc) · 901 Bytes
/
Copy pathconftest.py
File metadata and controls
32 lines (24 loc) · 901 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
29
30
31
32
"""Root conftest.py — pytest configuration for ARES project.
Registers the --run-live-llm option and live_llm marker for tests
that make real Anthropic API calls.
"""
import pytest
def pytest_addoption(parser):
parser.addoption(
"--run-live-llm",
action="store_true",
default=False,
help="Run tests that make live LLM API calls (requires ANTHROPIC_API_KEY)",
)
def pytest_configure(config):
config.addinivalue_line(
"markers",
"live_llm: marks tests that require live LLM API calls "
"(deselect with '-m \"not live_llm\"')",
)
def pytest_collection_modifyitems(config, items):
if not config.getoption("--run-live-llm"):
skip_live = pytest.mark.skip(reason="Need --run-live-llm option to run")
for item in items:
if "live_llm" in item.keywords:
item.add_marker(skip_live)