Repository navigation
test(python-flask): fix the stale assertion and re-enable testControllerTestModelExampleUsesImportedName - #25552
Merged
wing328 merged 1 commit intoNov 4, 2026
Conversation
…lerTestModelExampleUsesImportedName The test was disabled in OpenAPITools#25519 because its query_string assertion expected the pre-OpenAPITools#25485 rendering ('filter', Filter()). Object-typed query/header parameters are now sent in their OpenAPI wire style (form/explode pairs for the query object, a simple-style value for the header), and the body parameter is renamed to filter_ per OpenAPITools#25450. Update the expectations to the current generated output while keeping the test's purpose: model examples still use the imported class name ([Filter()], {'key': Filter()}, filter_ = Filter()), never the package-qualified openapi_server.Filter()/openapi_server.Trace(). Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
3 tasks
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.
Re-enables
PythonFlaskConnexionServerCodegenTest.testControllerTestModelExampleUsesImportedName, which was disabled in #25519 after failing on master.Why it failed
#25426 added the test expecting
query_string = [('filter', Filter()),]. Independently merged changes (#25485 / the object-typed parameter work in #25427, #25450) changed how the generated controller test renders those parameters, so the line the test looked for no longer exists. The generated code is correct; the assertion was stale.The generated
test_default_controller.pynow sends each parameter in its OpenAPI wire style instead of a Python repr:and the body parameter uses the sanitized name
filter_ = Filter()(#25450).What changed
The test now expects the current rendering while keeping its original purpose — model examples use the imported class name (
[Filter()],{'key': Filter()},filter_ = Filter()), never the package-qualifiedopenapi_server.Filter()/openapi_server.Trace()(still asserted viaassertFileNotContains).Test results
PythonFlaskConnexionServerCodegenTest+AbstractPythonConnexionServerCodegenTest: 48 tests run, 0 failures (baseline on master without this change: 47 run, 0 failures — the disabled test simply did not execute).query_string = [('filter', Filter()),])../mvnw -DskipTests verifypasses (checkstyle, forbiddenapis, coverage checks all clean).Follow-up to #25519 (requested by @wing328).
🤖 Generated with Claude Code
Summary by cubic
Re-enables
testControllerTestModelExampleUsesImportedName, which was disabled in #25519 because it asserted a rendering of model-typed parameters that no longer matches the generated code. Query and header model parameters are now emitted in OpenAPI wire style (form/explode pairs, simple-style values) and the body parameter is sanitized tofilter_, so the test expectations are updated to the current output. The test still verifies its original purpose: model examples use the imported class name ([Filter()],{'key': Filter()},filter_ = Filter()), never the package-qualifiedopenapi_server.Filter()/openapi_server.Trace().Written for commit b8d4a9e. Summary will update on new commits.