uranusjr commented on code in PR #22951:
URL: https://github.com/apache/airflow/pull/22951#discussion_r848572271


##########
tests/providers/airbyte/hooks/test_airbyte.py:
##########
@@ -98,20 +98,20 @@ def test_wait_for_job_incomplete_succeeded(self, 
mock_get_job):
         self.hook.wait_for_job(job_id=self.job_id, wait_seconds=0)
 
         calls = [mock.call(job_id=self.job_id), mock.call(job_id=self.job_id)]
-        assert mock_get_job.has_calls(calls)
+        mock_get_job.assert_has_calls(calls)
 
     @mock.patch('airflow.providers.airbyte.hooks.airbyte.AirbyteHook.get_job')
     def test_wait_for_job_timeout(self, mock_get_job):
         mock_get_job.side_effect = [
             self.return_value_get_job(self.hook.PENDING),
             self.return_value_get_job(self.hook.RUNNING),
-            self.return_value_get_job(self.hook.RUNNING),
         ]
         with pytest.raises(AirflowException, match="Timeout"):
             self.hook.wait_for_job(job_id=self.job_id, wait_seconds=2, 
timeout=1)
 
-        calls = [mock.call(job_id=self.job_id), mock.call(job_id=self.job_id), 
mock.call(job_id=self.job_id)]
-        assert mock_get_job.has_calls(calls)
+        calls = [mock.call(job_id=self.job_id)]
+        mock_get_job.assert_has_calls(calls)
+        assert mock_get_job.call_count == 1

Review Comment:
   ```suggestion
           assert mock_get_job.mock_calls == calls
   ```
   
   Succinct and clearer.



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