fix: resolve all lint errors (black, ruff, mypy)
Agent-Logs-Url: https://github.com/christianlouis/InboxConverge/sessions/343db360-b55f-461c-8bc6-3754f58ba48e Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
c65f37a8dd
commit
fcdd51e6aa
@@ -13,7 +13,6 @@ import socket
|
||||
import struct
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
from app.services.mail_processor import (
|
||||
_build_dns_query,
|
||||
@@ -24,7 +23,6 @@ from app.services.mail_processor import (
|
||||
_dns_cache_lock,
|
||||
)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Helpers
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
@@ -869,7 +869,6 @@ class TestFetchPop3Retry:
|
||||
@pytest.mark.asyncio
|
||||
async def test_retries_on_eof_error(self, mock_poplib, _mock_resolve):
|
||||
"""EOF error on first attempt triggers a retry; second attempt succeeds."""
|
||||
import asyncio
|
||||
import poplib as real_poplib
|
||||
|
||||
# First call raises EOF; second succeeds
|
||||
@@ -910,9 +909,7 @@ class TestFetchPop3Retry:
|
||||
account = _make_account(protocol="pop3_ssl")
|
||||
proc = MailProcessor(account, "secret")
|
||||
|
||||
with patch(
|
||||
"app.services.mail_processor.asyncio.sleep", new_callable=AsyncMock
|
||||
):
|
||||
with patch("app.services.mail_processor.asyncio.sleep", new_callable=AsyncMock):
|
||||
with pytest.raises(MailFetchError):
|
||||
await proc._fetch_pop3_emails(10, set())
|
||||
|
||||
|
||||
@@ -1945,7 +1945,9 @@ class TestNotificationBackoff:
|
||||
account = _make_account(delivery_method=DeliveryMethod.SMTP, **overrides)
|
||||
account.debug_logging = False
|
||||
account.debug_logging_run_count = 0
|
||||
account.error_notification_sent = overrides.get("error_notification_sent", False)
|
||||
account.error_notification_sent = overrides.get(
|
||||
"error_notification_sent", False
|
||||
)
|
||||
account.status = MagicMock(value="active")
|
||||
return account
|
||||
|
||||
@@ -1995,7 +1997,10 @@ class TestNotificationBackoff:
|
||||
mock_send_notification = AsyncMock(return_value=1)
|
||||
|
||||
with (
|
||||
patch(f"{MODULE}.async_session_maker", side_effect=[maker(), session_maker_side_effect()]),
|
||||
patch(
|
||||
f"{MODULE}.async_session_maker",
|
||||
side_effect=[maker(), session_maker_side_effect()],
|
||||
),
|
||||
patch(f"{MODULE}.engine", AsyncMock()),
|
||||
patch(f"{MODULE}.decrypt_credential", return_value="pw"),
|
||||
patch(f"{MODULE}.MailProcessor", return_value=mock_processor),
|
||||
|
||||
Reference in New Issue
Block a user