rusackas commented on PR #39997: URL: https://github.com/apache/superset/pull/39997#issuecomment-4489865026
According to my robot (beep boop!) @patch decorator argument order swapped in all 3 test functions Python's @patch stacks bottom-up — the decorator closest to the def injects the first parameter. In all three test functions, mock_sm and mock_find_by_id are in the wrong order. This means mock_find_by_id.return_value = MagicMock(...) is actually configuring the security_manager mock (a no-op), and mock_sm.raise_for_ownership = ... is setting an attribute on the find_by_id mock. The tests likely pass coincidentally due to MagicMock always being truthy, but they're not actually testing what they claim to test. The fix is to swap the parameter names in all three function signatures. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
