34 lines
980 B
Python
34 lines
980 B
Python
|
|
"""Pytest configuration for the test suite."""
|
||
|
|
import pytest
|
||
|
|
|
||
|
|
# Configure pytest-asyncio mode
|
||
|
|
pytest_plugins = ["pytest_asyncio"]
|
||
|
|
|
||
|
|
|
||
|
|
def pytest_configure(config):
|
||
|
|
"""Configure pytest."""
|
||
|
|
config.addinivalue_line(
|
||
|
|
"markers", "integration: mark test as integration test (requires MCP servers)"
|
||
|
|
)
|
||
|
|
|
||
|
|
|
||
|
|
def pytest_addoption(parser):
|
||
|
|
"""Add custom command-line options."""
|
||
|
|
parser.addoption(
|
||
|
|
"--run-integration",
|
||
|
|
action="store_true",
|
||
|
|
default=False,
|
||
|
|
help="Run integration tests that require MCP servers",
|
||
|
|
)
|
||
|
|
|
||
|
|
|
||
|
|
def pytest_collection_modifyitems(config, items):
|
||
|
|
"""Modify test collection based on options."""
|
||
|
|
if not config.getoption("--run-integration"):
|
||
|
|
skip_integration = pytest.mark.skip(
|
||
|
|
reason="Integration tests require --run-integration and MCP servers running"
|
||
|
|
)
|
||
|
|
for item in items:
|
||
|
|
if "integration" in item.keywords:
|
||
|
|
item.add_marker(skip_integration)
|