Documentation inconsistency: Client fixture pattern vs inline client creation #2937
Unanswered
healthkowshik
asked this question in
Q&A
Replies: 1 comment
-
|
I'm not sure about the official approach, but I'd follow the second pattern, possibly a variant using a reusable factory like this As per pytest-asyncio test and the fixture run in different asyncio event loops and each pytest scope has its own event loop - so the issue presented in the blogpost seems to be accurate. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Noticed conflicting guidance between official documentation and blog post regarding recommended pattern for testing MCP tools.
Official Documentation
Ref: https://gofastmcp.com/patterns/testing
The docs recommend an async fixture that yields the client:
Blog Post
Ref: https://www.jlowin.dev/blog/stop-vibe-testing-mcp-servers
The blog recommends creating the client inline within each test:
The blog includes a "Nerd note" that explicitly warns against the pattern shown in the official docs:
Questions
Thanks for the clarification!
Beta Was this translation helpful? Give feedback.
All reactions