From e151ffca08eeba3fd2685446320f57302a543631 Mon Sep 17 00:00:00 2001 From: Bert Blommers Date: Sat, 28 Dec 2024 22:20:38 -0100 Subject: [PATCH] Admin: Ruff formatting --- moto/awslambda/models.py | 10 +++++++--- moto/stepfunctions/responses.py | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/moto/awslambda/models.py b/moto/awslambda/models.py index 59020c64e1a6..ff722fc7a5ff 100644 --- a/moto/awslambda/models.py +++ b/moto/awslambda/models.py @@ -989,9 +989,13 @@ def _invoke_lambda(self, event: Optional[str] = None) -> Tuple[str, bool, str]: container = exit_code = None log_config = docker.types.LogConfig(type=docker.types.LogConfig.types.JSON) - with _DockerDataVolumeContext( - self - ) as data_vol, _DockerDataVolumeLayerContext(self) as layer_context: + # Ruff formats it like this, which is nice + # But the last mypy that supports Python 3.8 doesn't understand this syntax - hence the type: ignore + # We can remove it the moment we drop Python 3.8 + with ( + _DockerDataVolumeContext(self) as data_vol, # type: ignore[syntax] + _DockerDataVolumeLayerContext(self) as layer_context, + ): try: run_kwargs: Dict[str, Any] = dict() network_name = settings.moto_network_name() diff --git a/moto/stepfunctions/responses.py b/moto/stepfunctions/responses.py index 1b136026de6b..fd2e7bbfb1eb 100644 --- a/moto/stepfunctions/responses.py +++ b/moto/stepfunctions/responses.py @@ -116,7 +116,7 @@ def update_state_machine(self) -> TYPE_RESPONSE: ) response = {"updateDate": state_machine.update_date} if publish: - response["stateMachineVersionArn"] = state_machine.latest_version.arn # type: ignore + response["stateMachineVersionArn"] = state_machine.latest_version.arn # type: ignore return 200, {}, json.dumps(response) def list_tags_for_resource(self) -> TYPE_RESPONSE: