Sriniketh24 commented on PR #67141:
URL: https://github.com/apache/airflow/pull/67141#issuecomment-4531469912

   Thanks for the heads-up! I've pushed a fix for the CI failures — the test 
mocks had two issues:
   
   1. **Wrong MRO target**: `patch.object` was patching `__mro__[1]` 
(SessionExemptMixin) instead of `__mro__[2]` (SecureCookieSessionInterface). 
This meant `SessionExemptMixin.save_session()` — which accesses 
`flask.request.path` — was bypassed entirely, and the bytes-to-str wrapper in 
`AirflowSecureCookieSessionInterface.save_session()` wasn't being exercised 
through the real call chain.
   
   2. **Lambda signature mismatch**: `patch.object` replaces the class method 
with a `MagicMock` whose `side_effect` does **not** receive `self` when called 
via `super()`. The lambda expected `(self, app, session, response)` but only 
received `(app, session, response)`.
   
   The fix patches `__mro__[2]` directly, adds `patch("flask.request")` so 
SessionExemptMixin can check `request.path`, and uses `lambda *args, **kwargs:` 
for the side_effect.
   
   ---
   Drafted-by: Claude Code (Opus 4.7) (no human review before posting)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to