Skip to content

Commit

Permalink
Adjust to backwards-incompatible changes in aiosmtplib 3.x
Browse files Browse the repository at this point in the history
Signed-off-by: Aurélien Bompard <[email protected]>
  • Loading branch information
abompard committed Dec 8, 2023
1 parent 15cde4a commit 718487e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/+aiosmtplib-3.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adjust to backwards-incompatible changes in aiosmtplib 3.x
3 changes: 2 additions & 1 deletion fmn/sender/email.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
class EmailHandler(Handler):
async def setup(self):
self._smtp = SMTP(
self._config.get("smtp_host", "localhost"), self._config.get("smtp_port", 25)
hostname=self._config.get("smtp_host", "localhost"),
port=self._config.get("smtp_port", 25),
)
await self._smtp.connect()

Expand Down
2 changes: 1 addition & 1 deletion tests/sender/test_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async def test_email_connect(mocker):

await handler.setup()

smtp_class.assert_called_once_with("smtp.example.com", 487)
smtp_class.assert_called_once_with(hostname="smtp.example.com", port=487)
smtp.connect.assert_called_once_with()

await handler.stop()
Expand Down

0 comments on commit 718487e

Please sign in to comment.