Skip to content
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

Fix handling of custom response_wrapper in test.Client #2832

Merged
merged 1 commit into from
Mar 3, 2024

Conversation

jace
Copy link
Contributor

@jace jace commented Jan 8, 2024

This patch replaces the incorrect isinstance check with issubclass in how test.Client processes the response_wrapper argument. Without this patch, supplying a subclass of werkzeug.test.TestResponse and flask.wrappers.Response will fail with TypeError: Cannot create a consistent method resolution.

Checklist:

  • Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.
  • Add or update relevant docs, in the docs folder and in code.
  • Add an entry in CHANGES.rst summarizing the change and linking to the issue.
  • Add .. versionchanged:: entries in any relevant code docs.
  • Run pre-commit hooks and fix any issues.
  • Run pytest and tox, no tests failed.

@jace jace changed the title Fix handling of custom response_wrapper in test.Client (fixes #2831) Fix handling of custom response_wrapper in test.Client Jan 8, 2024
@pgjones pgjones changed the base branch from main to 3.0.x March 3, 2024 15:43
@pgjones pgjones merged commit 7ab3823 into pallets:3.0.x Mar 3, 2024
11 checks passed
pgjones added a commit that referenced this pull request Mar 3, 2024
@pgjones
Copy link
Member

pgjones commented Mar 3, 2024

Thank you

@jace jace deleted the testclient-response-check branch March 5, 2024 06:34
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test.Client is incorrectly using isinstance check instead of issubclass
2 participants