diff --git a/comet_core/api_helper.py b/comet_core/api_helper.py index c4565db..6f3d849 100644 --- a/comet_core/api_helper.py +++ b/comet_core/api_helper.py @@ -17,7 +17,7 @@ import logging from functools import wraps -from flask import g, Response, current_app +from flask import Response, current_app, g from comet_core.data_store import DataStore from comet_core.fingerprint import fingerprint_hmac diff --git a/comet_core/model.py b/comet_core/model.py index 43f517b..d75239e 100644 --- a/comet_core/model.py +++ b/comet_core/model.py @@ -16,7 +16,7 @@ import json from datetime import datetime -from sqlalchemy import Column, DateTime, Integer, JSON, String, UnicodeText, types +from sqlalchemy import JSON, Column, DateTime, Integer, String, UnicodeText, types from sqlalchemy.ext.declarative import declarative_base diff --git a/pyproject.toml b/pyproject.toml index 55ec8d7..1006ed5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,6 @@ +[tool.isort] +profile = "black" +line_length = 120 + [tool.black] line-length = 120 diff --git a/requirements-dev.txt b/requirements-dev.txt index f5e67bf..bc42c7f 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,3 +4,4 @@ pytest-cov==2.12.0 pytest-freezegun==0.4.2 tox==3.24.1 pylint==2.9.6 +isort==5.8.0 diff --git a/tests/conftest.py b/tests/conftest.py index e701eca..a4ad472 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -14,10 +14,11 @@ """Global test fixtures""" import os -from comet_core import Comet import pytest +from comet_core import Comet + @pytest.fixture def app(): diff --git a/tests/test_api_helper.py b/tests/test_api_helper.py index d0f340e..b955d4b 100644 --- a/tests/test_api_helper.py +++ b/tests/test_api_helper.py @@ -18,7 +18,7 @@ import pytest from comet_core.api import CometApi -from comet_core.api_helper import get_db, hydrate_open_issues, assert_valid_token, hydrate_with_request_headers +from comet_core.api_helper import assert_valid_token, get_db, hydrate_open_issues, hydrate_with_request_headers from comet_core.fingerprint import fingerprint_hmac diff --git a/tests/test_api_v0.py b/tests/test_api_v0.py index f8c741f..15e920a 100644 --- a/tests/test_api_v0.py +++ b/tests/test_api_v0.py @@ -17,7 +17,7 @@ from unittest import mock import pytest -from flask import g, Response +from flask import Response, g from comet_core.api import CometApi diff --git a/tests/test_app.py b/tests/test_app.py index 058f949..ca9253c 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -14,9 +14,9 @@ """Test comet_handler""" +import json from datetime import datetime, timedelta from unittest import mock -import json from freezegun import freeze_time diff --git a/tests/test_data_store.py b/tests/test_data_store.py index fa2e73e..287e26b 100644 --- a/tests/test_data_store.py +++ b/tests/test_data_store.py @@ -19,11 +19,11 @@ import pytest from freezegun import freeze_time -from tests.utils import get_all_test_messages import comet_core.data_store from comet_core.data_store import remove_duplicate_events from comet_core.model import EventRecord, IgnoreFingerprintRecord +from tests.utils import get_all_test_messages @pytest.fixture diff --git a/tests/test_fingerprinter.py b/tests/test_fingerprinter.py index 69c74dc..39ca7e3 100644 --- a/tests/test_fingerprinter.py +++ b/tests/test_fingerprinter.py @@ -16,7 +16,6 @@ from comet_core.fingerprint import comet_event_fingerprint - ORIG_DICT = {"a": "b", "b": "c", "res": {"lel": "wahat", "gl": "hf"}} ORIG_DICT_FP = "30c3e95d8fb3665ba70c6e3630a57d9a"