From 6eaeb27be0ca4ca0a4d762ea1f4647a2a963eecd Mon Sep 17 00:00:00 2001 From: "pre-commit-ci-lite[bot]" <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Date: Fri, 28 Nov 2025 11:50:57 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Auto=20format?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_validation_error_str.py | 36 +++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/tests/test_validation_error_str.py b/tests/test_validation_error_str.py index 26f5d6447..df192ad5f 100644 --- a/tests/test_validation_error_str.py +++ b/tests/test_validation_error_str.py @@ -9,7 +9,13 @@ from fastapi.exceptions import ( def test_request_validation_error_str_single_error(): """Test string representation of RequestValidationError with single error.""" - errors = [{"type": "int_parsing", "loc": ["query", "id"], "msg": "Input should be a valid integer"}] + errors = [ + { + "type": "int_parsing", + "loc": ["query", "id"], + "msg": "Input should be a valid integer", + } + ] exc = RequestValidationError(errors) result = str(exc) @@ -20,7 +26,11 @@ def test_request_validation_error_str_single_error(): def test_request_validation_error_str_multiple_errors(): """Test string representation of RequestValidationError with multiple errors.""" errors = [ - {"type": "int_parsing", "loc": ["query", "id"], "msg": "Input should be a valid integer"}, + { + "type": "int_parsing", + "loc": ["query", "id"], + "msg": "Input should be a valid integer", + }, {"type": "missing", "loc": ["query", "name"], "msg": "Field required"}, ] exc = RequestValidationError(errors) @@ -33,7 +43,13 @@ def test_request_validation_error_str_multiple_errors(): def test_websocket_request_validation_error_str_single_error(): """Test string representation of WebSocketRequestValidationError with single error.""" - errors = [{"type": "int_parsing", "loc": ["query", "id"], "msg": "Input should be a valid integer"}] + errors = [ + { + "type": "int_parsing", + "loc": ["query", "id"], + "msg": "Input should be a valid integer", + } + ] exc = WebSocketRequestValidationError(errors) result = str(exc) @@ -44,7 +60,11 @@ def test_websocket_request_validation_error_str_single_error(): def test_websocket_request_validation_error_str_multiple_errors(): """Test string representation of WebSocketRequestValidationError with multiple errors.""" errors = [ - {"type": "int_parsing", "loc": ["query", "id"], "msg": "Input should be a valid integer"}, + { + "type": "int_parsing", + "loc": ["query", "id"], + "msg": "Input should be a valid integer", + }, {"type": "missing", "loc": ["query", "name"], "msg": "Field required"}, ] exc = WebSocketRequestValidationError(errors) @@ -57,7 +77,13 @@ def test_websocket_request_validation_error_str_multiple_errors(): def test_response_validation_error_str_consistency(): """Test that ResponseValidationError has similar __str__ behavior.""" - errors = [{"type": "int_parsing", "loc": ["response", "id"], "msg": "Input should be a valid integer"}] + errors = [ + { + "type": "int_parsing", + "loc": ["response", "id"], + "msg": "Input should be a valid integer", + } + ] exc = ResponseValidationError(errors) result = str(exc)