You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
api_simulator Tests Missing importorskip Guards — macOS CI Failures #2255
8 tests fail on macOS-15 CI with ModuleNotFoundError: No module named 'api_simulator'. The api-simulator package is a Rust/PyO3 extension gated to Linux-only via PEP 508 marker in pyproject.toml:59:
"api-simulator; sys_platform == 'linux'",
When uv sync --locked --extra dev runs on macOS (sys_platform == 'darwin'), the package is never installed. Tests that import it without guards crash instead of being gracefully skipped.
Affected Tests
7 tests with bare import api_simulator.claude or import api_simulator.mcp inside test function bodies:
Server catches ImportError gracefully at src/autoskillit/server/_factory.py:241-248 and logs: "RECORD_SCENARIO is set but 'api_simulator' is not installed — skipping recording"
scenario.json is never written, assertion fails
Established Pattern
Other tests are properly guarded — follow the same approach:
# tests/execution/test_quota_http.py:17,25_api_sim_http=pytest.importorskip("api_simulator.http")
pytestmark= [
pytest.mark.skipif(sys.platform!="linux", reason="api-simulator is Linux-only"),
]
Required Fix
Add pytest.importorskip() at the top of each unguarded test function:
For test_factory_recording.py tests: pytest.importorskip("api_simulator.claude")
For test_state.py tests: pytest.importorskip("api_simulator.mcp")
For test_recording.py test: pytest.importorskip("api_simulator.claude")
For test_recording_sigterm.py test: pytest.importorskip("api_simulator") (entire package needed for recording premise)
Activity