eladkal commented on code in PR #74185:
URL: https://github.com/apache/airflow/pull/74185#discussion_r4409930379
##########
providers/smtp/tests/unit/smtp/hooks/test_smtp.py:
##########
@@ -720,6 +753,61 @@ async def test_async_connection(
assert mock_smtp_client.auth_login.await_count == 1
mock_smtp_client.auth_login.assert_awaited_once_with(SMTP_LOGIN,
SMTP_PASSWORD)
+ @pytest.mark.parametrize("failed_step", ["starttls", "ehlo", "auth_login",
"auth_xoauth2"])
+ @pytest.mark.parametrize("cleanup_fails", [False, True])
+ async def test_discards_failed_setup(self, mock_get_connection,
failed_step, cleanup_fails):
+ failed_client = mock.create_autospec(aiosmtplib.SMTP, instance=True)
+ healthy_client = mock.create_autospec(aiosmtplib.SMTP, instance=True)
+ for client in (failed_client, healthy_client):
+ client.auth_login = AsyncMock()
+ client.auth_xoauth2 = AsyncMock()
+ setup_error = OSError("setup failed")
Review Comment:
@drewrukin can you handle this?
--
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]