fix: Add Flask middleware tests and fix signal handler - #139
Merged
Conversation
- Add test_flask.py with 8 tests covering Flask middleware - Fix signal handler parameter conflict with Flask's got_request_exception signal - Add _handle_exception wrapper to properly receive signal kwargs
Contributor
Author
|
Could you have a look at this please, @ProRedCat @miquelbeltran ? The tests are fine, but I'm not 💯 about the additional bugfix to make some of the tests go. |
TheRealAgentK
marked this pull request as ready for review
January 21, 2026 00:45
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.
Summary
Adds missing Flask middleware tests and fixes a bug in the signal handler.
Changes
Tests added (
test_flask.py):test_provider_registered_as_extensiontest_attach_creates_sendertest_get_flask_environmenttest_send_exception_calls_sendertest_send_exception_without_attach_logs_errortest_send_exception_merges_extra_environment_datatest_exception_signal_triggers_sendtest_config_passed_to_senderBug fix (
flask.py):got_request_exceptionsignal passesexceptionas a kwarg, conflicting withsend_exception(exception=...)signature_handle_exceptionwrapper to properly receive signal kwargsTesting
All 101 tests pass.