test(api): gated live Ollama smoke (--run-live) + env docs
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
21
api/conftest.py
Normal file
21
api/conftest.py
Normal file
@@ -0,0 +1,21 @@
|
||||
"""Gate `@pytest.mark.live` tests (they hit a real Ollama) behind --run-live so
|
||||
the default suite stays hermetic. Run the live layer with: pytest --run-live
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
def pytest_addoption(parser):
|
||||
parser.addoption(
|
||||
"--run-live", action="store_true", default=False,
|
||||
help="run tests marked @pytest.mark.live (require a real Ollama)",
|
||||
)
|
||||
|
||||
|
||||
def pytest_collection_modifyitems(config, items):
|
||||
if config.getoption("--run-live"):
|
||||
return
|
||||
skip_live = pytest.mark.skip(reason="needs --run-live (real Ollama)")
|
||||
for item in items:
|
||||
if "live" in item.keywords:
|
||||
item.add_marker(skip_live)
|
||||
Reference in New Issue
Block a user