pierrejeambrun commented on code in PR #48056:
URL: https://github.com/apache/airflow/pull/48056#discussion_r2007939235


##########
airflow-core/tests/unit/api_fastapi/auth/managers/test_base_auth_manager.py:
##########
@@ -178,16 +179,19 @@ def test_get_authorized_menu_items(self, 
mock_filter_authorized_menu_items, auth
         
mock_filter_authorized_menu_items.assert_called_once_with(list(MenuItem), 
user=user)
         assert results == []
 
-    @patch("airflow.api_fastapi.auth.managers.base_auth_manager.JWTValidator", 
autospec=True)
+    @patch(
+        
"airflow.api_fastapi.auth.managers.base_auth_manager.BaseAuthManager._get_token_validator",
+        autospec=True,
+    )

Review Comment:
   Update the patching method because `_get_token_validator` is cached. So 
patching `base_auth_manager.JWTValidator` will set the cache value and 
interfere with other tests. (That are expecting another mock value, but it will 
return the first test cached one instead) 



-- 
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