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
Fixes from the testing-standards review of the new/modified test files.
Hollow-proof (the two SERIOUS findings):
- test_standalone_outbound_defaults_to_request_outbound: drop outbound= from from_envelope so
conn.outbound is the no-channel sentinel; traffic on the request outbound now proves the default
- test_server_info_version_falls_back_to_package: assert == importlib.metadata.version('mcp')
Assertion patterns:
- test_stateless_mode.py: 8x match= -> exc.value.method (structured attribute, not message text)
- test_streamable_http_modern.py: literal 404/400 status asserts (impl reads same table, so
table[X]==table[X] proved nothing); restore full-object json equality with id:None pin
- test_inbound.py: assert isinstance(route, InboundModernRoute) before frozen check
Constants: replace version/header/meta-key string literals with named imports across
test_session.py / test_streamable_http_modern.py.
Hygiene: drop from __future__ import annotations from tests/shared/test_inbound.py and
src/mcp/shared/inbound.py (no forward refs); duplicate StubOutbound locally in
test_stateless_mode.py (no cross-file test imports); _StubDispatchContext methods raise
NotImplementedError; private _request_handlers -> public get_request_handler.
Docstrings: add Spec-mandated:/SDK-defined: provenance tags to ~50 tests across 7 files.
Naming: test_cacheable_defaults -> test_discover_result_defaults_to_immediately_stale_private_cache;
test_header_rung_skipped_when_headers_none -> test_header_rung_does_not_reject_when_headers_arg_is_none;
drop 'handler' from test_serve_one_maps_error_... (it's kernel METHOD_NOT_FOUND).
0 commit comments