This is an automated email from the ASF dual-hosted git repository.
husseinawala pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 952d04a3c1 Fix EmrNotebookExecutionSensor broken test (#38354)
952d04a3c1 is described below
commit 952d04a3c10a7b511e4c39528d6f7aca7d729df6
Author: Hussein Awala <[email protected]>
AuthorDate: Thu Mar 21 01:04:14 2024 +0100
Fix EmrNotebookExecutionSensor broken test (#38354)
---
.../providers/amazon/aws/sensors/test_emr_notebook_execution.py | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/tests/providers/amazon/aws/sensors/test_emr_notebook_execution.py
b/tests/providers/amazon/aws/sensors/test_emr_notebook_execution.py
index 9f051cfcef..5a08622d36 100644
--- a/tests/providers/amazon/aws/sensors/test_emr_notebook_execution.py
+++ b/tests/providers/amazon/aws/sensors/test_emr_notebook_execution.py
@@ -65,12 +65,13 @@ class TestEmrNotebookExecutionSensor:
@mock.patch("airflow.providers.amazon.aws.hooks.emr.EmrHook.conn")
def test_emr_notebook_execution_sensor_success_state_multiple(self,
mock_conn):
return_values = [self._generate_response("PENDING") for i in range(2)]
- return_values =
return_values.append(self._generate_response("FINISHED"))
- mock_conn.describe_notebook_execution.side_effects = return_values
+ return_values.append(self._generate_response("FINISHED"))
+ mock_conn.describe_notebook_execution.side_effect = return_values
sensor = EmrNotebookExecutionSensor(
task_id="test_task",
poke_interval=0,
notebook_execution_id="test-execution-id",
)
- sensor.poke(None)
- mock_conn.describe_notebook_execution.call_count == 3
+ while not sensor.poke(None):
+ pass
+ assert mock_conn.describe_notebook_execution.call_count == 3