Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make isort, flake8, and black play well together #136

Merged
merged 1 commit into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
5 changes: 5 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ import-order-style = google
application-import-names = flake8
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
Loading