From 458e0233aeea155ed4be0cb2c42b980dc8cbbc36 Mon Sep 17 00:00:00 2001 From: Mathieu Leplatre Date: Fri, 26 Jan 2024 11:30:15 +0100 Subject: [PATCH] Run 'make format' --- src/kinto_http/cli_utils.py | 2 +- tests/conftest.py | 3 +-- tests/support.py | 1 - tests/test_async_client.py | 3 +-- tests/test_batch.py | 3 +-- tests/test_cli_utils.py | 3 +-- tests/test_client.py | 3 +-- tests/test_endpoints.py | 1 - tests/test_functional.py | 1 - tests/test_functional_async.py | 3 +-- tests/test_logging.py | 3 +-- tests/test_replication.py | 3 +-- tests/test_session.py | 11 +++++------ 13 files changed, 14 insertions(+), 26 deletions(-) diff --git a/src/kinto_http/cli_utils.py b/src/kinto_http/cli_utils.py index 81a4d31..aabd42e 100644 --- a/src/kinto_http/cli_utils.py +++ b/src/kinto_http/cli_utils.py @@ -59,7 +59,7 @@ def add_parser_options( default_collection=None, include_bucket=True, include_collection=True, - **kwargs + **kwargs, ): if parser is None: parser = argparse.ArgumentParser(**kwargs) diff --git a/tests/conftest.py b/tests/conftest.py index 3b9162e..b293175 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -4,13 +4,12 @@ import pytest import requests -from pytest_mock.plugin import MockerFixture - from kinto_http import AsyncClient, Client from kinto_http.constants import DEFAULT_AUTH, SERVER_URL, USER_AGENT from kinto_http.endpoints import Endpoints from kinto_http.exceptions import KintoException from kinto_http.session import Session +from pytest_mock.plugin import MockerFixture from .support import create_user, get_200, get_503, mock_response diff --git a/tests/support.py b/tests/support.py index 2054a0d..bb9e9a1 100644 --- a/tests/support.py +++ b/tests/support.py @@ -5,7 +5,6 @@ from urllib.parse import urljoin import requests - from kinto_http.constants import DEFAULT_AUTH from kinto_http.exceptions import KintoException diff --git a/tests/test_async_client.py b/tests/test_async_client.py index 01ce9b2..b5ab166 100644 --- a/tests/test_async_client.py +++ b/tests/test_async_client.py @@ -1,13 +1,12 @@ import re import pytest -from pytest_mock import MockerFixture - from kinto_http import AsyncClient as Client from kinto_http import BearerTokenAuth, BucketNotFound, KintoException from kinto_http.constants import DO_NOT_OVERWRITE, SERVER_URL from kinto_http.patch_type import JSONPatch, MergePatch from kinto_http.session import create_session +from pytest_mock import MockerFixture from .support import build_response, get_http_error, mock_response diff --git a/tests/test_batch.py b/tests/test_batch.py index 60af5cb..548c7f4 100644 --- a/tests/test_batch.py +++ b/tests/test_batch.py @@ -1,9 +1,8 @@ import pytest -from pytest_mock.plugin import MockerFixture - from kinto_http import Client from kinto_http.batch import BatchSession from kinto_http.exceptions import KintoException +from pytest_mock.plugin import MockerFixture def test_requests_are_stacked(batch_setup: Client, mocker: MockerFixture): diff --git a/tests/test_cli_utils.py b/tests/test_cli_utils.py index 9b6255d..0bb3348 100644 --- a/tests/test_cli_utils.py +++ b/tests/test_cli_utils.py @@ -1,9 +1,8 @@ import argparse -from pytest_mock import MockerFixture - from kinto_http import BearerTokenAuth, cli_utils from kinto_http.constants import ALL_PARAMETERS +from pytest_mock import MockerFixture from .support import assert_option_strings diff --git a/tests/test_client.py b/tests/test_client.py index 7298262..671a3fb 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -1,8 +1,6 @@ import re import pytest -from pytest_mock.plugin import MockerFixture - from kinto_http import ( BearerTokenAuth, BucketNotFound, @@ -13,6 +11,7 @@ ) from kinto_http.constants import DO_NOT_OVERWRITE, SERVER_URL from kinto_http.patch_type import JSONPatch, MergePatch +from pytest_mock.plugin import MockerFixture from .support import build_response, get_http_error, mock_response diff --git a/tests/test_endpoints.py b/tests/test_endpoints.py index 162d243..779c304 100644 --- a/tests/test_endpoints.py +++ b/tests/test_endpoints.py @@ -1,7 +1,6 @@ from typing import Dict, Tuple import pytest - from kinto_http import KintoException from kinto_http.endpoints import Endpoints diff --git a/tests/test_functional.py b/tests/test_functional.py index e0e59ce..e03ac49 100644 --- a/tests/test_functional.py +++ b/tests/test_functional.py @@ -2,7 +2,6 @@ from unittest import mock import pytest - from kinto_http import BucketNotFound, CollectionNotFound, KintoException, replication from kinto_http.patch_type import JSONPatch diff --git a/tests/test_functional_async.py b/tests/test_functional_async.py index 485a3ee..5b85499 100644 --- a/tests/test_functional_async.py +++ b/tests/test_functional_async.py @@ -1,8 +1,7 @@ import pytest -from pytest_mock import MockerFixture - from kinto_http import BucketNotFound, CollectionNotFound, KintoException from kinto_http.patch_type import JSONPatch +from pytest_mock import MockerFixture from .support import get_user_id diff --git a/tests/test_logging.py b/tests/test_logging.py index e223036..0182dce 100644 --- a/tests/test_logging.py +++ b/tests/test_logging.py @@ -1,6 +1,5 @@ -from pytest_mock.plugin import MockerFixture - from kinto_http import Client +from pytest_mock.plugin import MockerFixture def test_create_bucket_logs_info_message(client_setup: Client, mocker: MockerFixture): diff --git a/tests/test_replication.py b/tests/test_replication.py index 1af9108..61e35d9 100644 --- a/tests/test_replication.py +++ b/tests/test_replication.py @@ -1,7 +1,6 @@ -from pytest_mock import MockerFixture - from kinto_http import Client, exceptions from kinto_http.replication import replicate +from pytest_mock import MockerFixture from .support import mock_response diff --git a/tests/test_session.py b/tests/test_session.py index 3a20c5d..0aefb5c 100644 --- a/tests/test_session.py +++ b/tests/test_session.py @@ -5,14 +5,13 @@ from typing import Tuple from unittest.mock import MagicMock +import kinto_http import pkg_resources import pytest -from pytest_mock.plugin import MockerFixture - -import kinto_http from kinto_http.constants import USER_AGENT from kinto_http.exceptions import BackoffException, KintoException from kinto_http.session import Session, create_session +from pytest_mock.plugin import MockerFixture from .support import get_200, get_403, get_503, get_http_response @@ -162,7 +161,7 @@ def test_passed_data_is_encoded_to_json(session_setup: Tuple[MagicMock, Session] def test_passed_data_is_passed_as_is_when_files_are_posted( - session_setup: Tuple[MagicMock, Session] + session_setup: Tuple[MagicMock, Session], ): requests_mock, session = session_setup response = get_200() @@ -353,7 +352,7 @@ def test_passed_datetime_data_is_encoded_to_json(session_setup: Tuple[MagicMock, def test_passed_random_python_data_fails_to_be_encoded_to_json( - session_setup: Tuple[MagicMock, Session] + session_setup: Tuple[MagicMock, Session], ): _, session = session_setup with pytest.raises(TypeError) as exc: @@ -513,7 +512,7 @@ def test_forced_retry_after_overrides_value_of_header( def test_raises_exception_if_backoff_time_not_spent( - session_retry_setup: Tuple[MagicMock, Session] + session_retry_setup: Tuple[MagicMock, Session], ): requests_mock, session = session_retry_setup response = get_200()