Skip to content

Commit

Permalink
Run 'make format'
Browse files Browse the repository at this point in the history
  • Loading branch information
leplatrem committed Jan 26, 2024
1 parent d2af34d commit 458e023
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/kinto_http/cli_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion tests/support.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from urllib.parse import urljoin

import requests

from kinto_http.constants import DEFAULT_AUTH
from kinto_http.exceptions import KintoException

Expand Down
3 changes: 1 addition & 2 deletions tests/test_async_client.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
3 changes: 1 addition & 2 deletions tests/test_batch.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
3 changes: 1 addition & 2 deletions tests/test_cli_utils.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
3 changes: 1 addition & 2 deletions tests/test_client.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import re

import pytest
from pytest_mock.plugin import MockerFixture

from kinto_http import (
BearerTokenAuth,
BucketNotFound,
Expand All @@ -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

Expand Down
1 change: 0 additions & 1 deletion tests/test_endpoints.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from typing import Dict, Tuple

import pytest

from kinto_http import KintoException
from kinto_http.endpoints import Endpoints

Expand Down
1 change: 0 additions & 1 deletion tests/test_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions tests/test_functional_async.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
3 changes: 1 addition & 2 deletions tests/test_logging.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
3 changes: 1 addition & 2 deletions tests/test_replication.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
11 changes: 5 additions & 6 deletions tests/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 458e023

Please sign in to comment.