Compare commits

...

1 Commits

Author SHA1 Message Date
Hermes Agent
c94d3cf3bf fix: ACP test collection fails without acp extra; ssh mark unregistered (#779)
Some checks are pending
Contributor Attribution Check / check-attribution (pull_request) Waiting to run
Docker Build and Publish / build-and-push (pull_request) Waiting to run
Supply Chain Audit / Scan PR for supply chain risks (pull_request) Waiting to run
Tests / test (pull_request) Waiting to run
Tests / e2e (pull_request) Waiting to run
Resolves #779. Two issues fixed:

tests/acp/conftest.py (new):
- Module-level collect_ignore when acp is not installed
- Prevents pytest --collect-only from failing with ModuleNotFoundError
- 6 ACP test files cleanly skipped instead of erroring

tests/conftest.py:
- Registered ssh, integration, slow pytest markers
- Eliminates PytestUnknownMarkWarning

Before: 11,470 collected, 6 errors
After:  11,472 collected, 0 errors
2026-04-15 11:09:27 -04:00
2 changed files with 28 additions and 0 deletions

20
tests/acp/conftest.py Normal file
View File

@@ -0,0 +1,20 @@
"""ACP test conftest — skip collection when acp extra not installed.
This conftest.py uses collect_ignore at module level to prevent
pytest from trying to import test files that depend on acp.
"""
try:
import acp # noqa: F401
except ImportError:
# Tell pytest to skip this entire directory during collection
collect_ignore = [
"test_entry.py",
"test_events.py",
"test_mcp_e2e.py",
"test_permissions.py",
"test_server.py",
"test_session.py",
"test_tools.py",
"test_auth.py",
]

View File

@@ -15,6 +15,12 @@ PROJECT_ROOT = Path(__file__).parent.parent
if str(PROJECT_ROOT) not in sys.path:
sys.path.insert(0, str(PROJECT_ROOT))
# Register custom markers
def pytest_configure(config):
config.addinivalue_line("markers", "ssh: marks tests requiring SSH connectivity")
config.addinivalue_line("markers", "integration: marks integration tests")
config.addinivalue_line("markers", "slow: marks slow tests")
@pytest.fixture(autouse=True)
def _isolate_hermes_home(tmp_path, monkeypatch):
@@ -119,3 +125,5 @@ def _enforce_test_timeout():
yield
signal.alarm(0)
signal.signal(signal.SIGALRM, old)