SEPURI-SAI-KRISHNA commented on PR #74171: URL: https://github.com/apache/airflow/pull/74171#issuecomment-6722654595
Added `autospec=True` to the three patches. On the two `AwsTaskLogFetcher` ones it does exactly what you expected: the constructor is keyword-only, so a renamed or misspelled kwarg now fails the test instead of being accepted silently. I checked that against the real class, and a plain `Mock` does accept a bogus kwarg where the autospec one raises `TypeError`. On the `AwsLogsHook` one it is inert, because `AwsLogsHook.__init__` is `(*args, **kwargs)` and forwards to `AwsBaseHook`, so there is no signature for mock to bind against. I left it on anyway for consistency with the mocking guidance, but it is not buying the kwarg check there. -- 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]
