Skip to content

Commit

Permalink
Make isort, flake8, and black play well together
Browse files Browse the repository at this point in the history
  • Loading branch information
pcmxgti committed Oct 6, 2023
1 parent 80249c0 commit 2067da6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import os
import sys

from setuptools import find_packages, setup

from setuptools import find_packages
from setuptools import setup

here = os.path.abspath(os.path.dirname(__file__))

Expand Down
1 change: 0 additions & 1 deletion tests/functional_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ def test_generate_config(custom_args, config_file):
def test_generate_credentials(custom_args, config_file):
"""Run the tool and generate credentials."""
import pyotp

from tokendito import config
from tokendito import user

Expand Down
15 changes: 8 additions & 7 deletions tests/unit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ def test_tty_assertion():
"""Test the availability of stdin."""
import os
import sys

from tokendito.user import tty_assertion

from io import UnsupportedOperation

# Save for reuse
Expand Down Expand Up @@ -313,7 +315,6 @@ def test_update_ini(tmpdir):
def test_assert_credentials():
"""Test whether getting credentials works as expeted."""
from moto import mock_sts

from tokendito import aws

with pytest.raises(SystemExit) as err:
Expand Down Expand Up @@ -637,8 +638,8 @@ def test_mfa_provider_type(
sample_headers,
):
"""Test whether function return key on specific MFA provider."""
from tokendito.okta import mfa_provider_type
from tokendito import Config
from tokendito.okta import mfa_provider_type

payload = {"x": "y", "t": "z"}
callback_url = "https://www.acme.org"
Expand Down Expand Up @@ -673,8 +674,8 @@ def test_mfa_provider_type(

def test_bad_mfa_provider_type(mocker, sample_headers):
"""Test whether function return key on specific MFA provider."""
from tokendito.okta import mfa_provider_type
from tokendito import Config
from tokendito.okta import mfa_provider_type

pytest_config = Config()
payload = {"x": "y", "t": "z"}
Expand Down Expand Up @@ -1089,7 +1090,6 @@ def test_get_duo_sid(mocker):
def test_authenticate_to_roles(status_code, monkeypatch):
"""Test if function return correct response."""
import requests

from tokendito.aws import authenticate_to_roles

mock_get = {"status_code": status_code, "text": "response"}
Expand All @@ -1112,6 +1112,7 @@ def test_config_object():
"""Test proper initialization of the Config object."""
import json
import sys

from tokendito import Config

# Test for invalid assignments to the object
Expand Down Expand Up @@ -1680,8 +1681,8 @@ def test_send_saml_response(mocker):

def test_authenticate(mocker):
"""Test authentication."""
from tokendito import okta
from tokendito import Config
from tokendito import okta

pytest_config = Config(
okta={
Expand Down Expand Up @@ -1712,8 +1713,8 @@ def test_authenticate(mocker):

def test_local_auth(mocker):
"""Test local auth method."""
from tokendito import okta
from tokendito import Config
from tokendito import okta

pytest_config = Config(
okta={
Expand All @@ -1731,8 +1732,8 @@ def test_local_auth(mocker):

def test_saml2_auth(mocker):
"""Test saml2 authentication."""
from tokendito import okta
from tokendito import Config
from tokendito import okta

auth_properties = {"id": "id", "metadata": "metadata"}

Expand Down
7 changes: 6 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,14 @@ max-complexity = 8
exclude = .git, __pycache__, .tox, build/, .venv/, venv/
extend-ignore = E203, W503
import-order-style = google
application-import-names = flake8
application-import-names = google
format = %(cyan)s%(path)s%(reset)s:%(bold)s%(yellow)s%(row)d%(reset)s:%(bold)s%(green)s%(col)d%(reset)s: %(bold)s%(red)s%(code)s%(reset)s %(text)s

[isort]
profile = google
known_first_party = io
known_third_party = tokendito

[pytest]
env =
PIP_DISABLE_PIP_VERSION_CHECK=1

0 comments on commit 2067da6

Please sign in to comment.