hankehly commented on code in PR #30981:
URL: https://github.com/apache/airflow/pull/30981#discussion_r1181365520


##########
tests/providers/google/cloud/hooks/test_pubsub.py:
##########
@@ -384,13 +395,14 @@ def test_publish_api_call_error(self, mock_service):
         publish_method.side_effect = GoogleAPICallError(f"Error publishing to 
topic {EXPANDED_SUBSCRIPTION}")
 
         with pytest.raises(PubSubException):
-            self.pubsub_hook.publish(project_id=TEST_PROJECT, 
topic=TEST_TOPIC, messages=TEST_MESSAGES)
+            self.pubsub_hook.publish(project_id=TEST_PROJECT, 
topic=TEST_TOPIC, messages=[{"data": b"test"}])

Review Comment:
   Since the publish function throws an exception regardless of the value of 
`messages`, there was no need to continue using the global variable 
`TEST_MESSAGES`.



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