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)