Skip to content

Commit

Permalink
flake8-tidy-imports (#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
squeaky-pl authored Feb 17, 2022
1 parent f68b20a commit 186932c
Show file tree
Hide file tree
Showing 19 changed files with 26 additions and 19 deletions.
7 changes: 6 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,9 @@ ignore=
SFS201
# https://pypi.org/project/flake8-future-import/
FI1
exclude=migrations/versions
banned-modules=
flask.ext = use flask_
builtins = don't use
typing.Text = use str
mock = use unittest.mock
exclude=migrations/versions
1 change: 1 addition & 0 deletions requirements/lint.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ flake8-future-import==0.4.6
flake8-no-u-prefixed-strings==0.2
flake8-simplify==0.14.2
flake8-sfs==0.0.3
flake8-tidy-imports==4.6.0
mccabe==0.6.1
regex==2020.9.27
pathspec==0.8.0
Expand Down
1 change: 0 additions & 1 deletion requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ funcsigs==1.0.2
freezegun==1.1.0
hypothesis==6.30.0
iniconfig==1.1.1
mock==1.3.0
mockredispy==2.9.3
more-itertools==5.0.0
packaging==20.9
Expand Down
2 changes: 1 addition & 1 deletion tests/api/test_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import sys
from datetime import datetime
from hashlib import md5
from unittest import mock

import mock
import pytest

from inbox.models import Block, Part
Expand Down
3 changes: 2 additions & 1 deletion tests/api/test_folders.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# flake8: noqa: F401, F811
from unittest import mock

import gevent
import mock

from inbox.util.testutils import mock_imapclient # noqa

Expand Down
2 changes: 1 addition & 1 deletion tests/api/test_invalid_account.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import datetime
import json
from unittest import mock

import mock
import pytest
import requests

Expand Down
2 changes: 1 addition & 1 deletion tests/api/test_messages.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import json
from unittest import mock

import mock
import pytest

from inbox.api.ns_api import API_VERSIONS
Expand Down
2 changes: 1 addition & 1 deletion tests/api/test_searching.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import datetime
import json
from unittest import mock

import mock
import pytest
import requests
from pytest import fixture
Expand Down
2 changes: 1 addition & 1 deletion tests/events/test_google_events.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import json
from unittest import mock

import arrow
import gevent
import mock
import pytest
import requests

Expand Down
2 changes: 1 addition & 1 deletion tests/general/test_message_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"""Sanity-check our construction of a Message object from raw synced data."""
import datetime
import sys
from unittest.mock import patch

import pytest
from flanker import mime
from mock import patch

from inbox.models import Block, Message
from inbox.util.addr import parse_mimepart_address_header
Expand Down
3 changes: 2 additions & 1 deletion tests/imap/test_actions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# flake8: noqa: F401, F811
from unittest import mock

import gevent
import mock
import pytest
from flanker import mime

Expand Down
2 changes: 1 addition & 1 deletion tests/imap/test_crispin_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
by some providers (Gmail, Fastmail).
"""
from datetime import datetime
from unittest import mock

import imapclient
import mock
import pytest

from inbox.crispin import (
Expand Down
3 changes: 2 additions & 1 deletion tests/imap/test_full_imap_enabled.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from unittest.mock import Mock

from imapclient import IMAPClient
from mock import Mock

from inbox.auth.generic import GenericAuthHandler
from inbox.basicauth import UserRecoverableConfigError
Expand Down
2 changes: 1 addition & 1 deletion tests/imap/test_pooling.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import imaplib
import socket
import ssl
from unittest import mock

import gevent
import mock
import pytest

from inbox.crispin import CrispinConnectionPool
Expand Down
2 changes: 1 addition & 1 deletion tests/imap/test_smtp.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import smtplib
from unittest import mock

import mock
import pytest

from inbox.logging import get_logger
Expand Down
2 changes: 1 addition & 1 deletion tests/scheduling/test_sync_start_logic.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json
import platform
from unittest import mock

import mock
import pytest

from inbox.ignition import engine_manager
Expand Down
3 changes: 1 addition & 2 deletions tests/test_instrumentation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import time

import mock
from unittest import mock

from inbox.instrumentation import GreenletTracer

Expand Down
2 changes: 1 addition & 1 deletion tests/util/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import os
import uuid
from datetime import datetime, timedelta
from unittest import mock

import mock
from flanker import mime
from mockredis import mock_strict_redis_client
from pytest import fixture
Expand Down
2 changes: 1 addition & 1 deletion tests/webhooks/test_gpush_calendar_notifications.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from datetime import datetime, timedelta
from unittest import mock

import limitlion
import mock
import pytest
from gevent import sleep

Expand Down

0 comments on commit 186932c

Please sign in to comment.