Taragolis commented on code in PR #33780:
URL: https://github.com/apache/airflow/pull/33780#discussion_r1307185448


##########
tests/providers/amazon/aws/hooks/test_glue.py:
##########
@@ -30,6 +30,9 @@
 from airflow.providers.amazon.aws.hooks.base_aws import AwsBaseHook
 from airflow.providers.amazon.aws.hooks.glue import GlueJobHook
 
+if TYPE_CHECKING:
+    from unittest.mock import MagicMock

Review Comment:
   I guess the root issue why this import even exists that PyCharm (and maybe 
others IDE) can't correctly use annotation  from `@mock.patch` and 
`@mock.patch.object`, so you need to set in explicitly if you want to use 
autosuggestion/autocompletion from the IDE.
   
   I found for myself that use fixtures do not required to manually annotate 
`mock.patch` for IDE
   ```python
   @pytest.fixture
   def awesome_fixture():
       with mock.patch("foo.bar.spam.Egg") as m:
           yield m
   ```



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