From 3808404ec3520200a6402739d5ec19d689a713fa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 28 Jan 2024 07:50:16 +0000 Subject: [PATCH] chore(deps): update dependency dev/black to v24 Signed-off-by: JP-Ellis --- pact/v3/ffi.py | 108 ++++++------------ pact/v3/pact.py | 33 +++--- pyproject.toml | 2 +- .../v3/compatiblity_suite/test_v1_consumer.py | 12 +- tests/v3/conftest.py | 1 - tests/v3/test_ffi.py | 1 + 6 files changed, 59 insertions(+), 98 deletions(-) diff --git a/pact/v3/ffi.py b/pact/v3/ffi.py index 4d085aaca6..78c025deaa 100644 --- a/pact/v3/ffi.py +++ b/pact/v3/ffi.py @@ -101,32 +101,25 @@ # to inform the type checker of the existence of these types. -class AsynchronousMessage: - ... +class AsynchronousMessage: ... -class Consumer: - ... +class Consumer: ... -class Generator: - ... +class Generator: ... -class GeneratorCategoryIterator: - ... +class GeneratorCategoryIterator: ... -class GeneratorKeyValuePair: - ... +class GeneratorKeyValuePair: ... -class HttpRequest: - ... +class HttpRequest: ... -class HttpResponse: - ... +class HttpResponse: ... class InteractionHandle: @@ -160,84 +153,64 @@ def __repr__(self) -> str: return f"InteractionHandle({self._ref!r})" -class MatchingRule: - ... +class MatchingRule: ... -class MatchingRuleCategoryIterator: - ... +class MatchingRuleCategoryIterator: ... -class MatchingRuleDefinitionResult: - ... +class MatchingRuleDefinitionResult: ... -class MatchingRuleIterator: - ... +class MatchingRuleIterator: ... -class MatchingRuleKeyValuePair: - ... +class MatchingRuleKeyValuePair: ... -class MatchingRuleResult: - ... +class MatchingRuleResult: ... -class Message: - ... +class Message: ... -class MessageContents: - ... +class MessageContents: ... -class MessageHandle: - ... +class MessageHandle: ... -class MessageMetadataIterator: - ... +class MessageMetadataIterator: ... -class MessageMetadataPair: - ... +class MessageMetadataPair: ... -class MessagePact: - ... +class MessagePact: ... -class MessagePactHandle: - ... +class MessagePactHandle: ... -class MessagePactMessageIterator: - ... +class MessagePactMessageIterator: ... -class MessagePactMetadataIterator: - ... +class MessagePactMetadataIterator: ... -class MessagePactMetadataTriple: - ... +class MessagePactMetadataTriple: ... -class Mismatch: - ... +class Mismatch: ... -class Mismatches: - ... +class Mismatches: ... -class MismatchesIterator: - ... +class MismatchesIterator: ... -class Pact: - ... +class Pact: ... class PactHandle: @@ -327,8 +300,7 @@ def port(self) -> int: return self._ref -class PactInteraction: - ... +class PactInteraction: ... class PactInteractionIterator: @@ -535,36 +507,28 @@ def __next__(self) -> SynchronousMessage: return pact_sync_message_iter_next(self) -class Provider: - ... +class Provider: ... -class ProviderState: - ... +class ProviderState: ... -class ProviderStateIterator: - ... +class ProviderStateIterator: ... -class ProviderStateParamIterator: - ... +class ProviderStateParamIterator: ... -class ProviderStateParamPair: - ... +class ProviderStateParamPair: ... -class SynchronousHttp: - ... +class SynchronousHttp: ... -class SynchronousMessage: - ... +class SynchronousMessage: ... -class VerifierHandle: - ... +class VerifierHandle: ... class ExpressionValueType(Enum): diff --git a/pact/v3/pact.py b/pact/v3/pact.py index 7ef64e5b31..bb655d2d31 100644 --- a/pact/v3/pact.py +++ b/pact/v3/pact.py @@ -107,16 +107,13 @@ def _parse_interaction_part( raise ValueError(msg) @overload - def given(self, state: str) -> Self: - ... + def given(self, state: str) -> Self: ... @overload - def given(self, state: str, *, name: str, value: str) -> Self: - ... + def given(self, state: str, *, name: str, value: str) -> Self: ... @overload - def given(self, state: str, *, parameters: dict[str, Any] | str) -> Self: - ... + def given(self, state: str, *, parameters: dict[str, Any] | str) -> Self: ... def given( self, @@ -1027,24 +1024,21 @@ def upon_receiving( self, description: str, interaction: Literal["HTTP"] = ..., - ) -> HttpInteraction: - ... + ) -> HttpInteraction: ... @overload def upon_receiving( self, description: str, interaction: Literal["Async"], - ) -> AsyncMessageInteraction: - ... + ) -> AsyncMessageInteraction: ... @overload def upon_receiving( self, description: str, interaction: Literal["Sync"], - ) -> SyncMessageInteraction: - ... + ) -> SyncMessageInteraction: ... def upon_receiving( self, @@ -1149,19 +1143,22 @@ def messages(self) -> pact.v3.ffi.PactMessageIterator: return pact.v3.ffi.pact_handle_get_message_iter(self._handle) @overload - def interactions(self, kind: Literal["HTTP"]) -> pact.v3.ffi.PactSyncHttpIterator: - ... + def interactions( + self, + kind: Literal["HTTP"], + ) -> pact.v3.ffi.PactSyncHttpIterator: ... @overload def interactions( self, kind: Literal["Sync"], - ) -> pact.v3.ffi.PactSyncMessageIterator: - ... + ) -> pact.v3.ffi.PactSyncMessageIterator: ... @overload - def interactions(self, kind: Literal["Async"]) -> pact.v3.ffi.PactMessageIterator: - ... + def interactions( + self, + kind: Literal["Async"], + ) -> pact.v3.ffi.PactMessageIterator: ... def interactions( self, diff --git a/pyproject.toml b/pyproject.toml index 9a12dce550..3494246734 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -79,7 +79,7 @@ test = [ dev = [ "pact-python[types]", "pact-python[test]", - "black ==23.12.1", + "black ==24.1.1", "ruff ==0.1.14", ] diff --git a/tests/v3/compatiblity_suite/test_v1_consumer.py b/tests/v3/compatiblity_suite/test_v1_consumer.py index 9807f67cf0..e402bb6820 100644 --- a/tests/v3/compatiblity_suite/test_v1_consumer.py +++ b/tests/v3/compatiblity_suite/test_v1_consumer.py @@ -453,9 +453,9 @@ def request_n_is_made_to_the_mock_server( return requests.request( definition.method, str(srv.url.with_path(definition.path)), - params=URL.build(query_string=definition.query).query - if definition.query - else None, + params=( + URL.build(query_string=definition.query).query if definition.query else None + ), headers=definition.headers if definition.headers else None, # type: ignore[arg-type] data=definition.body.bytes if definition.body else None, ) @@ -502,9 +502,9 @@ def request_n_is_made_to_the_mock_server_with_the_following_changes( return requests.request( definition.method, str(srv.url.with_path(definition.path)), - params=URL.build(query_string=definition.query).query - if definition.query - else None, + params=( + URL.build(query_string=definition.query).query if definition.query else None + ), headers=definition.headers if definition.headers else None, # type: ignore[arg-type] data=definition.body.bytes if definition.body else None, ) diff --git a/tests/v3/conftest.py b/tests/v3/conftest.py index eb69d16fa6..b75fc47922 100644 --- a/tests/v3/conftest.py +++ b/tests/v3/conftest.py @@ -5,7 +5,6 @@ directory. """ - import pytest diff --git a/tests/v3/test_ffi.py b/tests/v3/test_ffi.py index 53e00361da..496240e1c5 100644 --- a/tests/v3/test_ffi.py +++ b/tests/v3/test_ffi.py @@ -5,6 +5,7 @@ They are not intended to test the Pact API itself, as that is handled by the client library. """ + import re import pytest