From 9a23ce2f5296b659823d57011b3e7bcae047cb28 Mon Sep 17 00:00:00 2001 From: artsmolin Date: Fri, 27 Oct 2023 13:23:13 +0300 Subject: [PATCH] Refactoring --- .pre-commit-config.yaml | 6 ------ examples/petstore/client_async.py | 4 ++-- examples/petstore/client_sync.py | 4 ++-- tests/clients/async_client.py | 4 ++-- tests/clients/async_client_with_headers.py | 4 ++-- tests/clients/async_client_with_metrics.py | 4 ++-- tests/clients/sync_client.py | 4 ++-- tests/clients/sync_client_with_metrics.py | 4 ++-- 8 files changed, 14 insertions(+), 20 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4b36b89..9121056 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,9 +14,3 @@ repos: hooks: - id: mypy additional_dependencies: [ types-PyYAML ] - - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 - hooks: - - id: trailing-whitespace - - id: end-of-file-fixer diff --git a/examples/petstore/client_async.py b/examples/petstore/client_async.py index 26d6015..58b54d7 100644 --- a/examples/petstore/client_async.py +++ b/examples/petstore/client_async.py @@ -93,7 +93,7 @@ def log_extra(self, **kwargs: Any) -> dict[str, Any]: return {"props": {"data": kwargs}} def log_error(self, req: RequestBox, resp: ResponseBox) -> None: - msg = "request error" + msg = f"request error" msg += f" | client={req.client_name}" msg += f" | method={req.method}" msg += f" | url={req.url}" @@ -2266,7 +2266,7 @@ def log_extra(self, **kwargs: Any) -> dict[str, Any]: return {"extra": {"props": {"data": kwargs}}} def log_error(self, client_name: str, method, url: str, params, content, headers) -> None: - msg = "request error" + msg = f"request error" msg += f" | client={client_name}" msg += f" | method={method}" msg += f" | url={url}" diff --git a/examples/petstore/client_sync.py b/examples/petstore/client_sync.py index f2421d5..e2976ee 100644 --- a/examples/petstore/client_sync.py +++ b/examples/petstore/client_sync.py @@ -93,7 +93,7 @@ def log_extra(self, **kwargs: Any) -> dict[str, Any]: return {"props": {"data": kwargs}} def log_error(self, req: RequestBox, resp: ResponseBox) -> None: - msg = "request error" + msg = f"request error" msg += f" | client={req.client_name}" msg += f" | method={req.method}" msg += f" | url={req.url}" @@ -2242,7 +2242,7 @@ def log_extra(self, **kwargs: Any) -> dict[str, Any]: return {"extra": {"props": {"data": kwargs}}} def log_error(self, client_name: str, method, url: str, params, content, headers) -> None: - msg = "request error" + msg = f"request error" msg += f" | client={client_name}" msg += f" | method={method}" msg += f" | url={url}" diff --git a/tests/clients/async_client.py b/tests/clients/async_client.py index 445b0a7..ab13eab 100644 --- a/tests/clients/async_client.py +++ b/tests/clients/async_client.py @@ -101,7 +101,7 @@ def log_extra(self, **kwargs: Any) -> dict[str, Any]: return {"props": {"data": kwargs}} def log_error(self, req: RequestBox, resp: ResponseBox) -> None: - msg = "request error" + msg = f"request error" msg += f" | client={req.client_name}" msg += f" | method={req.method}" msg += f" | url={req.url}" @@ -2657,7 +2657,7 @@ def log_extra(self, **kwargs: Any) -> dict[str, Any]: return {"extra": {"props": {"data": kwargs}}} def log_error(self, client_name: str, method, url: str, params, content, headers) -> None: - msg = "request error" + msg = f"request error" msg += f" | client={client_name}" msg += f" | method={method}" msg += f" | url={url}" diff --git a/tests/clients/async_client_with_headers.py b/tests/clients/async_client_with_headers.py index f88ded3..44eb3bc 100644 --- a/tests/clients/async_client_with_headers.py +++ b/tests/clients/async_client_with_headers.py @@ -101,7 +101,7 @@ def log_extra(self, **kwargs: Any) -> dict[str, Any]: return {"props": {"data": kwargs}} def log_error(self, req: RequestBox, resp: ResponseBox) -> None: - msg = "request error" + msg = f"request error" msg += f" | client={req.client_name}" msg += f" | method={req.method}" msg += f" | url={req.url}" @@ -2660,7 +2660,7 @@ def log_extra(self, **kwargs: Any) -> dict[str, Any]: return {"extra": {"props": {"data": kwargs}}} def log_error(self, client_name: str, method, url: str, params, content, headers) -> None: - msg = "request error" + msg = f"request error" msg += f" | client={client_name}" msg += f" | method={method}" msg += f" | url={url}" diff --git a/tests/clients/async_client_with_metrics.py b/tests/clients/async_client_with_metrics.py index 7f59c2d..51b7ec5 100644 --- a/tests/clients/async_client_with_metrics.py +++ b/tests/clients/async_client_with_metrics.py @@ -133,7 +133,7 @@ def log_extra(self, **kwargs: Any) -> dict[str, Any]: return {"props": {"data": kwargs}} def log_error(self, req: RequestBox, resp: ResponseBox) -> None: - msg = "request error" + msg = f"request error" msg += f" | client={req.client_name}" msg += f" | method={req.method}" msg += f" | url={req.url}" @@ -2689,7 +2689,7 @@ def log_extra(self, **kwargs: Any) -> dict[str, Any]: return {"extra": {"props": {"data": kwargs}}} def log_error(self, client_name: str, method, url: str, params, content, headers) -> None: - msg = "request error" + msg = f"request error" msg += f" | client={client_name}" msg += f" | method={method}" msg += f" | url={url}" diff --git a/tests/clients/sync_client.py b/tests/clients/sync_client.py index 8420050..ea0239a 100644 --- a/tests/clients/sync_client.py +++ b/tests/clients/sync_client.py @@ -101,7 +101,7 @@ def log_extra(self, **kwargs: Any) -> dict[str, Any]: return {"props": {"data": kwargs}} def log_error(self, req: RequestBox, resp: ResponseBox) -> None: - msg = "request error" + msg = f"request error" msg += f" | client={req.client_name}" msg += f" | method={req.method}" msg += f" | url={req.url}" @@ -2623,7 +2623,7 @@ def log_extra(self, **kwargs: Any) -> dict[str, Any]: return {"extra": {"props": {"data": kwargs}}} def log_error(self, client_name: str, method, url: str, params, content, headers) -> None: - msg = "request error" + msg = f"request error" msg += f" | client={client_name}" msg += f" | method={method}" msg += f" | url={url}" diff --git a/tests/clients/sync_client_with_metrics.py b/tests/clients/sync_client_with_metrics.py index a7b6baf..da3ec7f 100644 --- a/tests/clients/sync_client_with_metrics.py +++ b/tests/clients/sync_client_with_metrics.py @@ -133,7 +133,7 @@ def log_extra(self, **kwargs: Any) -> dict[str, Any]: return {"props": {"data": kwargs}} def log_error(self, req: RequestBox, resp: ResponseBox) -> None: - msg = "request error" + msg = f"request error" msg += f" | client={req.client_name}" msg += f" | method={req.method}" msg += f" | url={req.url}" @@ -2655,7 +2655,7 @@ def log_extra(self, **kwargs: Any) -> dict[str, Any]: return {"extra": {"props": {"data": kwargs}}} def log_error(self, client_name: str, method, url: str, params, content, headers) -> None: - msg = "request error" + msg = f"request error" msg += f" | client={client_name}" msg += f" | method={method}" msg += f" | url={url}"