tests/client/test_client.py: 14 failures on Windows — AttributeError: '...Result' object has no attribute '_meta' · Issue #3544 · modelcontextprotocol/python-sdk · GitHub
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
tests/client/test_client.py: 14 failures on Windows — AttributeError: '...Result' object has no attribute '_meta' #3544
On a clean checkout of main, tests/client/test_client.py fails with 14 errors of the form AttributeError: 'CallToolResult' object has no attribute '_meta'. Did you mean: 'meta'?
The snapshots pass the wire name (snapshot(CallToolResult(_meta={...}))), but inline_snapshot's generic_call_adapter.argument() does a plain getattr(value, '_meta') and the pydantic model exposes the field as meta. The data is there — the repr shows meta={'io.modelcontextprotocol/serverInfo': ...}.
I'd expect the test suite to pass on a fresh clone with locked dependencies.
Ruled out: unlocked dependency resolution (reproduced with --frozen and --no-sync), Python version (3.12.14 and 3.14.2 both fail), and a non-ASCII checkout path (reproduces under a plain ASCII path too).
I only have Windows to test on, so I don't know whether this reproduces on Linux or macOS. If CI is green, the difference is presumably platform-specific and I'm happy to run whatever would help narrow it down.
This isn't Windows-specific, it happens whenever pytest runs in a terminal: on Linux (main f1b6589) uv run pytest tests/client/test_client.py under a pty gives the same 14 failures, and across the 10 test files that use _meta= inside snapshot() it's 63 failed / 426 passed. pyproject.toml:335 sets default-flags = ["disable"] for inline-snapshot but not default-flags-tui, so in a terminal it falls back to create,review and generic_call_adapter.py:386 does getattr(value, "_meta") on models that only expose meta. CI is green because inline-snapshot disables itself when CI is set, and ./scripts/test is green because xdist workers have no TTY. Adding default-flags-tui = ["disable"] makes all 489 pass under a pty; the alternative is rewriting the _meta= literals to meta= so snapshot review stays usable locally. Which would you prefer? If you're taking an outside PR for this, I'd like to do it, and the fix is ready.
Activity
shubhangi013 commentedon Sep 19, 2026
Hi, I would like to work on this issue
jayzuccarelli commentedon Sep 25, 2026
This isn't Windows-specific, it happens whenever pytest runs in a terminal: on Linux (main f1b6589)
uv run pytest tests/client/test_client.pyunder a pty gives the same 14 failures, and across the 10 test files that use_meta=insidesnapshot()it's 63 failed / 426 passed. pyproject.toml:335 setsdefault-flags = ["disable"]for inline-snapshot but notdefault-flags-tui, so in a terminal it falls back tocreate,reviewandgeneric_call_adapter.py:386doesgetattr(value, "_meta")on models that only exposemeta. CI is green because inline-snapshot disables itself whenCIis set, and./scripts/testis green because xdist workers have no TTY. Addingdefault-flags-tui = ["disable"]makes all 489 pass under a pty; the alternative is rewriting the_meta=literals tometa=so snapshot review stays usable locally. Which would you prefer? If you're taking an outside PR for this, I'd like to do it, and the fix is ready.