test: fix three pre-existing failures on Python 3.10 and fastmcp 3.4.3 - #518
Open
Sallvainian wants to merge 1 commit into
Open
test: fix three pre-existing failures on Python 3.10 and fastmcp 3.4.3#518Sallvainian wants to merge 1 commit into
Sallvainian wants to merge 1 commit into
Conversation
These fail on master today; the test workflow is pull_request-triggered, so master never runs it and the breakage only surfaces on contributors' PRs. test_mcp_shutdown_patch referenced ExceptionGroup, a 3.11+ builtin, so on 3.10 the name was undefined and the handler raised NameError instead of asserting anything. The exceptiongroup backport is already locked for python < 3.11, so import it there rather than leaving the name unbound. test_turns_discoverability read the turns description at parameters["properties"]["turns"]["description"]. fastmcp 3.4.3 emits an optional parameter as an anyOf union and carries the description on a nested member, so the key is absent at the top level and the assertion raised KeyError. The description is still present and still correct -- only its position moved -- so resolve it recursively instead of pinning one nesting shape, which keeps the test working across fastmcp versions rather than trading one version check for another. Verified: 3.10 and 3.12 both 16 passed for these two files (3.10 was 3 failed), and the full suite on 3.10 is 1918 passed, 56 skipped, 0 failed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three tests fail on
mastertoday. TheTest Voice Mode MCPworkflow ispull_request-triggered, somasternever runs it — the breakage only shows upon contributors' PRs, where it reads as "your branch broke CI".
Reproduced on a clean
mastercheckout with no other changes present:ExceptionGroupon Python 3.10ExceptionGrouponly became a builtin in 3.11, so on 3.10 the name is undefinedand the assertion raises
NameErrorinstead of testing anything.exceptiongroupis already locked as a dependency for
python_full_version < '3.11'(uv.lock),so this imports the backport there rather than adding anything new.
turnsschema description on fastmcp 3.4.3The tests read
tool.parameters["properties"]["turns"]["description"]. fastmcp3.4.3 emits an optional parameter as an
anyOfunion and carries thedescription on a nested member, so the key is absent at the top level:
The description is still present and still byte-for-byte correct — only its
position moved. Rather than hardcode the new shape (which just swaps one version
assumption for another), the lookup now walks
anyOfmembers recursively, so itpasses on both the old and new layouts.
test_turns_param_description_constant_matches_readme_literal_textis untouchedand still enforces the golden README text, so the drift guard this file exists
for is unaffected.
Verification
Test-only; no runtime code touched, so no CHANGELOG entry.
Split out from #517 so the CI fix can land independently of that PR.