From bee2bb95b5932de029eaf644e397780a24270377 Mon Sep 17 00:00:00 2001 From: beobest2 Date: Wed, 1 May 2024 22:39:14 -0400 Subject: [PATCH] Fix: test for deferable operation --- tests/providers/amazon/aws/operators/test_emr_containers.py | 3 +-- tests/providers/amazon/aws/sensors/test_emr_containers.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/providers/amazon/aws/operators/test_emr_containers.py b/tests/providers/amazon/aws/operators/test_emr_containers.py index 99c8b067bdee37..fa5c4764b87ea8 100644 --- a/tests/providers/amazon/aws/operators/test_emr_containers.py +++ b/tests/providers/amazon/aws/operators/test_emr_containers.py @@ -152,8 +152,7 @@ def test_operator_defer_with_timeout(self, mock_submit_job, mock_check_query_sta self.emr_container.deferrable = True self.emr_container.max_polling_attempts = 1000 - error_match = "Waiter error: max attempts reached" - with pytest.raises(AirflowException, match=error_match): + with pytest.raises(TaskDeferred): self.emr_container.execute(context=None) assert mock_check_query_status.call_count == 1000 diff --git a/tests/providers/amazon/aws/sensors/test_emr_containers.py b/tests/providers/amazon/aws/sensors/test_emr_containers.py index 273b0c795115fc..048533cb60e6c6 100644 --- a/tests/providers/amazon/aws/sensors/test_emr_containers.py +++ b/tests/providers/amazon/aws/sensors/test_emr_containers.py @@ -92,8 +92,7 @@ def test_sensor_defer_with_timeout(self, mock_check_query_status): self.sensor.deferrable = True self.sensor.max_polling_attempts = 1000 - error_match = "Waiter error: max attempts reached" - with pytest.raises(TaskDeferred, match=error_match): + with pytest.raises(TaskDeferred): self.sensor.execute(context=None) assert mock_check_query_status.call_count == 1000