vandonr-amz commented on code in PR #28039:
URL: https://github.com/apache/airflow/pull/28039#discussion_r1037610212
##########
tests/providers/amazon/aws/hooks/test_glue_crawler.py:
##########
@@ -83,18 +82,17 @@
}
-class TestGlueCrawlerHook(unittest.TestCase):
- @classmethod
- def setUp(cls):
- cls.hook = GlueCrawlerHook(aws_conn_id="aws_default")
+class TestGlueCrawlerHook:
+ def setup_method(self):
+ self.hook = GlueCrawlerHook(aws_conn_id="aws_default")
def test_init(self):
- self.assertEqual(self.hook.aws_conn_id, "aws_default")
+ assert self.hook.aws_conn_id == "aws_default"
@mock.patch.object(GlueCrawlerHook, "get_conn")
def test_has_crawler(self, mock_get_conn):
response = self.hook.has_crawler(mock_crawler_name)
- self.assertEqual(response, True)
+ assert response
Review Comment:
nit: I find it more readable to use `assert response is True` (or `is
False`) when asserting on boolean values, it reads more like English.
##########
tests/providers/amazon/aws/hooks/test_emr_containers.py:
##########
@@ -110,7 +109,9 @@ def test_query_status_polling_with_timeout(self,
mock_session):
mock_session.return_value = emr_session_mock
emr_client_mock.describe_job_run.return_value = JOB2_RUN_DESCRIPTION
- query_status =
self.emr_containers.poll_query_status(job_id="job123456",
max_polling_attempts=2)
+ query_status = self.emr_containers.poll_query_status(
+ job_id="job123456", max_polling_attempts=2, poll_interval=2
+ )
Review Comment:
nice, but do we need to wait at all ? is `poll_interval = 0` an option ?
--
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]