ashb commented on code in PR #48491:
URL: https://github.com/apache/airflow/pull/48491#discussion_r2022258543


##########
providers/amazon/tests/unit/amazon/aws/log/test_cloudwatch_task_handler.py:
##########
@@ -53,6 +57,111 @@ def logmock():
         yield
 
 
+# We only test this directly on Airflow 3
+
+
[email protected](not AIRFLOW_V_3_0_PLUS, reason="This path only works on 
Airflow 3")
+class TestCloudRemoteLogIO:
+    # We use the cap_structlog so that our changes get reverted for us
+    @pytest.fixture(autouse=True)
+    def setup_tests(self, create_runtime_ti, tmp_path, monkeypatch):
+        import structlog
+
+        import airflow.logging_config
+        import airflow.sdk.log
+        from airflow.sdk import BaseOperator
+
+        task = BaseOperator(task_id="task_1")
+        self.ti = create_runtime_ti(task)
+
+        self.remote_log_group = "log_group_name"
+        self.region_name = "us-west-2"
+        self.local_log_location = tmp_path / "local-cloudwatch-log-location"
+        self.local_log_location.mkdir()
+
+        # The subject under test
+        self.subject = CloudWatchRemoteLogIO(
+            base_log_folder=self.local_log_location,
+            
log_group_arn=f"arn:aws:logs:{self.region_name}:11111111:log-group:{self.remote_log_group}",
+            log_stream_name="dag_id=a/0.log",
+        )
+
+        conn = boto3.client("logs", region_name=self.region_name)

Review Comment:
   No, moto is set up globally in the test file (not changed here)



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