-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Doc update + validation in SseServerTransport + existing test fixes: addresses Issue: #827 #900
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Doc update + validation in SseServerTransport + existing test fixes: addresses Issue: #827 #900
Conversation
…hoice was made. Realted Issue: modelcontextprotocol#827
Removed usage of snapshot in parametrised test as they don't work well together and end up failing the test.
tests/client/test_auth.py
Outdated
@@ -968,8 +967,7 @@ def test_build_metadata( | |||
revocation_options=RevocationOptions(enabled=True), | |||
) | |||
|
|||
assert metadata == snapshot( | |||
OAuthMetadata( | |||
assert metadata == OAuthMetadata( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the error you were having?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few observations
- This test is passing in GitHub workflow
- In local, when I delete pycache and run
uv run pytest tests/client/test_auth.py
it passes - In local, when I run
uv run pytest
it fails again
Since there does not seem to be an issue in the workflow I have reverted this change, or alternatively we can create explicit snapshot for each parameter similar to mentioned here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on improving MCP Python SDK.
Please can those changes be split in different PRs?
for sse it would be great to add tests for the changes to prevent regression
SseServerTransport
only supports partial url forendpoint
+ validating the same.test_messages_are_executed_concurrently
: Removed flakiness from the test.test_build_metadata
: Removed usage of snapshot in assert condition in the test. Using snapshot is failing the test even if the function itself is working. This was because of parameterisation. After some research online found that not using snapshot after creation would be a better way to handle this scenario.Motivation and Context
This relates to the issue reported here: #827
The doc string is slightly misleading as it mentioned that we can pass the absolute URL as well, which is not true in code implementation or best practices.
Fixed tests that were breaking when I run
uv run pytest
.How Has This Been Tested?
Existing test cases pass.
Breaking Changes
No.
Types of changes
Checklist