@@ -177,18 +177,25 @@ def test_timeout_error_raised_if_no_messages_received_when_waiting(self):
177177 with self .assertRaises (TimeoutError ):
178178 service .wait_for_answer (subscription = mock_subscription , timeout = 0.01 )
179179
180- def test_error_raised_if_attempting_to_wait_for_answer_from_push_subscription (self ):
180+ def test_error_raised_if_attempting_to_wait_for_answer_from_non_pull_subscription (self ):
181181 """Test that an error is raised if attempting to wait for an answer from a push subscription."""
182- mock_subscription = MockSubscription (
183- name = "world" ,
184- topic = MockTopic (name = "world" , project_name = TEST_PROJECT_NAME ),
185- push_endpoint = "https://example.com/endpoint" ,
186- )
187-
188182 service = Service (backend = BACKEND )
189183
190- with self .assertRaises (exceptions .NotAPullSubscription ):
191- service .wait_for_answer (subscription = mock_subscription )
184+ for subscription in [
185+ MockSubscription (
186+ name = "world" ,
187+ topic = MockTopic (name = "world" , project_name = TEST_PROJECT_NAME ),
188+ push_endpoint = "https://example.com/endpoint" ,
189+ ),
190+ MockSubscription (
191+ name = "world" ,
192+ topic = MockTopic (name = "world" , project_name = TEST_PROJECT_NAME ),
193+ bigquery_table_id = "some-table" ,
194+ ),
195+ ]:
196+ with self .subTest (subscription = subscription ):
197+ with self .assertRaises (exceptions .NotAPullSubscription ):
198+ service .wait_for_answer (subscription = subscription )
192199
193200 def test_exceptions_in_responder_are_handled_and_sent_to_asker (self ):
194201 """Test that exceptions raised in the child service are handled and sent back to the asker."""
0 commit comments