Configures ruff as the one stop linter and resolves warnings it raised

This commit is contained in:
Trenton H
2023-03-28 09:39:30 -07:00
parent 43fad82c94
commit d2c02b9102
110 changed files with 507 additions and 491 deletions

View File

@@ -47,7 +47,7 @@ class TestMailLiveServer(TestCase):
except MailError as e:
self.fail(f"Failure: {e}")
except Exception as e:
except Exception:
pass
def test_process_non_gmail_server_tag(self):
@@ -66,5 +66,5 @@ class TestMailLiveServer(TestCase):
except MailError as e:
self.fail(f"Failure: {e}")
except Exception as e:
except Exception:
pass

View File

@@ -12,11 +12,8 @@ from unittest import mock
from django.core.management import call_command
from django.db import DatabaseError
from django.test import TestCase
from documents.data_models import ConsumableDocument
from documents.data_models import DocumentMetadataOverrides
from documents.models import Correspondent
from documents.tests.utils import DirectoriesMixin
from documents.tests.utils import DocumentConsumeDelayMixin
from documents.tests.utils import FileSystemAssertsMixin
from imap_tools import EmailAddress
from imap_tools import FolderInfo
@@ -183,7 +180,7 @@ class BogusMailBox(ContextManager):
)
self.messages = list(filter(lambda m: m.uid not in uid_list, self.messages))
else:
raise Exception()
raise Exception
def fake_magic_from_buffer(buffer, mime=False):
@@ -769,7 +766,7 @@ class TestMail(
with self.assertRaisesRegex(
MailError,
"Error while authenticating account",
) as context:
):
self.mail_account_handler.handle_mail_account(account)
def test_error_skip_account(self):