Skip to content

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

AishwaryaKalloli
Copy link

  1. Doc update to correctly reflect that SseServerTransport only supports partial url for endpoint + validating the same.
  2. test_messages_are_executed_concurrently: Removed flakiness from the test.
  3. test_build_metadata: Removed usage of snapshot in asset in the test as the object is created, 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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Removed usage of snapshot in parametrised test as they don't work well together and end up failing the test.
@@ -968,8 +967,7 @@ def test_build_metadata(
revocation_options=RevocationOptions(enabled=True),
)

assert metadata == snapshot(
OAuthMetadata(
assert metadata == OAuthMetadata(
Copy link
Member

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?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when I run uv run pytest I get the following error:
image

As a fix I tried running:
uv run pytest --inline-snapshot=fix tests/client/test_auth.py but got the same error again, alternatively I tried using Is for parameterised variables, but that did not seem like fully correct either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants