failed WRONG_FIX wrong_fix ยท 32 tool calls ยท 193 s ยท fastapi/fastapi
๐ Add a custom `FastAPIDeprecationWarning` ๐ Add a custom `FastAPIDeprecationWarning` and use it for deprecated logic, like Pydantic v1 models. Motivated by: https://sethmlarson.dev/deprecations-via-warnings-dont-work-for-python-libraries
| # | Tool | Arguments | Result |
|---|---|---|---|
| 1 | run_command | {
"command": "grep -rn \"DeprecationWarning\" fastapi | head -20"
} | {"status": "ok", "stdout": "fastapi/dependencies/utils.py:330: category=DeprecationWarning,\nfastapi/temp_pydantic_v1_params.py:66: category=DeprecationWarning,full{"status": "ok", "stdout": "fastapi/dependencies/utils.py:330: category=DeprecationWarning,\nfastapi/temp_pydantic_v1_params.py:66: category=DeprecationWarning,\nfastapi/temp_pydantic_v1_params.py:96: category=DeprecationWarning,\nfastapi/temp_pydantic_v1_params.py:506: category=DeprecationWarning,\nfastapi/temp_pydantic_v1_params.py:536: category=DeprecationWarning,\nfastapi/routing.py:643: category=DeprecationWarning,\nfastapi/routing.py:683: category=DeprecationWarning,\nfastapi/utils.py:200: DeprecationWarning,\nfastapi/params.py:78: category=DeprecationWarning,\nfastapi/params.py:108: category=DeprecationWarning,\nfastapi/params.py:533: category=DeprecationWarning,\nfastapi/params.py:563: category=DeprecationWarning,\nfastapi/openapi/utils.py:220: DeprecationWarning,\n", "exit_code": 0} |
| 2 | run_command | {
"command": "grep -rn \"pydantic.v1\" fastapi | head -20"
} | {"status": "ok", "stdout": "fastapi/dependencies/utils.py:47:from fastapi._compat.shared import annotation_is_pydantic_v1\nfastapi/dependencies/utils.py:75:fromfull{"status": "ok", "stdout": "fastapi/dependencies/utils.py:47:from fastapi._compat.shared import annotation_is_pydantic_v1\nfastapi/dependencies/utils.py:75:from .. import temp_pydantic_v1_params\nfastapi/dependencies/utils.py:328: \"pydantic.v1 is deprecated and will soon stop being supported by FastAPI.\"\nfastapi/dependencies/utils.py:334: param_details.field.field_info, (params.Body, temp_pydantic_v1_params.Body)\nfastapi/dependencies/utils.py:403: temp_pydantic_v1_params.Param,\nfastapi/dependencies/utils.py:405: temp_pydantic_v1_params.Body,\nfastapi/dependencies/utils.py:494: if annotation_is_pydantic_v1(use_annotation):\nfastapi/dependencies/utils.py:495: field_info = temp_pydantic_v1_params.Body( # type: ignore[assignment]\nfastapi/dependencies/utils.py:511: field_info, (params.Path, temp_pydantic_v1_params.Path)\nfastapi/dependencies/utils.py:517: isinstance(field_info, (params.Param, temp_pydantic_v1_params.Param))\nfastapi/dependencies/utils.py:526: if isinstance(field_info, (params.Form, temp_pydantic_v1_params.Form)):\nfastapi/dependencies/utils.py:546: elif isinstance(field_info, (params.Query, temp_pydantic_v1_params.Query)):\nfastapi/dependencies/utils.py:765: isinstance(field.field_info, (params.Form, temp_pydantic_v1_params.Form))\nfastapi/dependencies/utils.py:835: assert isinstance(field_info, (params.Param, temp_pydantic_v1_params.Param)), (\nfastapi/dependencies/utils.py:847: assert isinstance(field_info, (params.Param, temp_pydantic_v1_params.Param)), (\nfastapi/dependencies/utils.py:896: isinstance(first_field.field_info, (params.Form, temp_pydantic_v1_params.Form))\nfastapi/dependencies/utils.py:914: isinstance(field_info, (params.File, temp_pydantic_v1_params.File))\nfastapi/dependencies/utils.py:921: and isinstance(field_info, (params.File, temp_pydantic_v1_ |
| 3 | run_command | {
"command": "grep -rn \"FastAPIDeprecationWarning\" fastapi"
} | {"status": "error", "error_type": "CommandError", "error_message": "Command failed with exit code 1", "details": {"stdout": "", "stderr": "", "exit_code": 1}}full{"status": "error", "error_type": "CommandError", "error_message": "Command failed with exit code 1", "details": {"stdout": "", "stderr": "", "exit_code": 1}} |
| 4 | read_file | {
"filepath": "fastapi/exceptions.py"
} | {"status": "ok", "filepath": "fastapi/exceptions.py", "content": "from collections.abc import Sequence\nfrom typing import Annotated, Any, Optional, TypedDict, full{"status": "ok", "filepath": "fastapi/exceptions.py", "content": "from collections.abc import Sequence\nfrom typing import Annotated, Any, Optional, TypedDict, Union\n\nfrom annotated_doc import Doc\nfrom pydantic import BaseModel, create_model\nfrom starlette.exceptions import HTTPException as StarletteHTTPException\nfrom starlette.exceptions import WebSocketException as StarletteWebSocketException\n\n\nclass EndpointContext(TypedDict, total=False):\n function: str\n path: str\n file: str\n line: int\n\n\nclass HTTPException(StarletteHTTPException):\n \"\"\"\n An HTTP exception you can raise in your own code to show errors to the client.\n\n This is for client errors, invalid authentication, invalid data, etc. Not for server\n errors in your code.\n\n Read more about it in the\n [FastAPI docs for Handling Errors](https://fastapi.tiangolo.com/tutorial/handling-errors/).\n\n ## Example\n\n ```python\n from fastapi import FastAPI, HTTPException\n\n app = FastAPI()\n\n items = {\"foo\": \"The Foo Wrestlers\"}\n\n\n @app.get(\"/items/{item_id}\")\n async def read_item(item_id: str):\n if item_id not in items:\n raise HTTPException(status_code=404, detail=\"Item not found\")\n return {\"item\": items[item_id]}\n ```\n \"\"\"\n\n def __init__(\n self,\n status_code: Annotated[\n int,\n Doc(\n \"\"\"\n HTTP status code to send to the client.\n \"\"\"\n ),\n ],\n detail: Annotated[\n Any,\n Doc(\n \"\"\"\n Any data to be sent to the client in the `detail` key of the JSON\n response.\n \"\"\"\n ),\n ] = None,\n headers: Annotated[\n Optional[dict[str, str]],\n Doc(\n \"\"\"\n Any headers to send to the client in the response.\n |
| 5 | edit_file | {
"filepath": "fastapi/exceptions.py",
"new_string": "from collections.abc import Sequence\nfrom typing import Annotated, Any, Optional, TypedDict, Union\n\nfrom annotated_doc import Doc\nfrom pydantic import BaseModel, create_model\nfrom starlette.exceptions import HTTPException as StarletteHTTPException\nfrom starlette.exceptions import WebSocketException as StarletteWebSocketException\n\n\nclass FastAPIDeprecationWarning(DeprecationWarning):\n \\\"\\\"\\\"\n A custom deprecation warning for FastAPI.\n \\\"\\\"\\\"\n\n\nclass EndpointContext(TypedDict, total=False):\n",
"old_string": "from collections.abc import Sequence\nfrom typing import Annotated, Any, Optional, TypedDict, Union\n\nfrom annotated_doc import Doc\nfrom pydantic import BaseModel, create_model\nfrom starlette.exceptions import HTTPException as StarletteHTTPException\nfrom starlette.exceptions import WebSocketException as StarletteWebSocketException\n\n\nclass EndpointContext(TypedDict, total=False):\n"
} | {"status": "ok", "filepath": "fastapi/exceptions.py", "occurrences": 1, "strategy": "exact", "diff": "--- a/fastapi/exceptions.py\n+++ b/fastapi/exceptions.py\nfull{"status": "ok", "filepath": "fastapi/exceptions.py", "occurrences": 1, "strategy": "exact", "diff": "--- a/fastapi/exceptions.py\n+++ b/fastapi/exceptions.py\n@@ -5,6 +5,12 @@\n from pydantic import BaseModel, create_model\n from starlette.exceptions import HTTPException as StarletteHTTPException\n from starlette.exceptions import WebSocketException as StarletteWebSocketException\n+\n+\n+class FastAPIDeprecationWarning(DeprecationWarning):\n+ \\\"\\\"\\\"\n+ A custom deprecation warning for FastAPI.\n+ \\\"\\\"\\\"\n \n \n class EndpointContext(TypedDict, total=False):\n", "is_truncated": false} |
| 6 | read_file | {
"filepath": "fastapi/dependencies/utils.py",
"start_line": 320,
"end_line": 340
} | {"status": "ok", "filepath": "fastapi/dependencies/utils.py", "content": " ):\n assert param_details.field is None, (\n f\"Cannot specify multiple FastAPI annotfull{"status": "ok", "filepath": "fastapi/dependencies/utils.py", "content": " ):\n assert param_details.field is None, (\n f\"Cannot specify multiple FastAPI annotations for {param_name!r}\"\n )\n continue\n assert param_details.field is not None\n if isinstance(param_details.field, may_v1.ModelField):\n warnings.warn(\n \"pydantic.v1 is deprecated and will soon stop being supported by FastAPI.\"\n f\" Please update the param {param_name}: {param_details.type_annotation!r}.\",\n category=DeprecationWarning,\n stacklevel=5,\n )\n if isinstance(\n param_details.field.field_info, (params.Body, temp_pydantic_v1_params.Body)\n ):\n dependant.body_params.append(param_details.field)\n else:\n add_param_to_fields(field=param_details.field, dependant=dependant)\n return dependant\n\n", "start_line": 320, "end_line": 340, "total_lines": 1069, "is_truncated": false} |
| 7 | edit_file | {
"filepath": "fastapi/dependencies/utils.py",
"new_string": "from fastapi import params\nfrom fastapi.exceptions import FastAPIDeprecationWarning\nfrom fastapi._compat import may_v1\n",
"old_string": "from fastapi import params\nfrom fastapi._compat import may_v1\n"
} | {"status": "error", "error_type": "FileEditError", "error_message": "old_string not found in file (tried exact, flexible and regex matching)"}full{"status": "error", "error_type": "FileEditError", "error_message": "old_string not found in file (tried exact, flexible and regex matching)"} |
| 8 | read_file | {
"end_line": 50,
"filepath": "fastapi/dependencies/utils.py",
"start_line": 1
} | {"status": "ok", "filepath": "fastapi/dependencies/utils.py", "content": "import dataclasses\nimport inspect\nimport sys\nimport warnings\nfrom collections.abc full{"status": "ok", "filepath": "fastapi/dependencies/utils.py", "content": "import dataclasses\nimport inspect\nimport sys\nimport warnings\nfrom collections.abc import Coroutine, Mapping, Sequence\nfrom contextlib import AsyncExitStack, contextmanager\nfrom copy import copy, deepcopy\nfrom dataclasses import dataclass\nfrom typing import (\n Annotated,\n Any,\n Callable,\n ForwardRef,\n Optional,\n Union,\n cast,\n)\n\nimport anyio\nfrom fastapi import params\nfrom fastapi._compat import (\n ModelField,\n RequiredParam,\n Undefined,\n _is_error_wrapper,\n _is_model_class,\n copy_field_info,\n create_body_model,\n evaluate_forwardref,\n field_annotation_is_scalar,\n get_annotation_from_field_info,\n get_cached_model_fields,\n get_missing_field_error,\n is_bytes_field,\n is_bytes_sequence_field,\n is_scalar_field,\n is_scalar_sequence_field,\n is_sequence_field,\n is_uploadfile_or_nonable_uploadfile_annotation,\n is_uploadfile_sequence_annotation,\n lenient_issubclass,\n may_v1,\n sequence_types,\n serialize_sequence_value,\n value_is_sequence,\n)\nfrom fastapi._compat.shared import annotation_is_pydantic_v1\nfrom fastapi.background import BackgroundTasks\nfrom fastapi.concurrency import (\n asynccontextmanager,\n", "start_line": 1, "end_line": 50, "total_lines": 1069, "is_truncated": false} |
| 9 | edit_file | {
"filepath": "fastapi/dependencies/utils.py",
"new_string": "from fastapi import params\nfrom fastapi.exceptions import FastAPIDeprecationWarning\nfrom fastapi._compat import (\n",
"old_string": "from fastapi import params\nfrom fastapi._compat import (\n"
} | {"status": "ok", "filepath": "fastapi/dependencies/utils.py", "occurrences": 1, "strategy": "exact", "diff": "--- a/fastapi/dependencies/utils.py\n+++ b/fastapifull{"status": "ok", "filepath": "fastapi/dependencies/utils.py", "occurrences": 1, "strategy": "exact", "diff": "--- a/fastapi/dependencies/utils.py\n+++ b/fastapi/dependencies/utils.py\n@@ -18,6 +18,7 @@\n \n import anyio\n from fastapi import params\n+from fastapi.exceptions import FastAPIDeprecationWarning\n from fastapi._compat import (\n ModelField,\n RequiredParam,\n", "is_truncated": false} |
| 10 | edit_file | {
"filepath": "fastapi/dependencies/utils.py",
"new_string": " if isinstance(param_details.field, may_v1.ModelField):\n warnings.warn(\n \"pydantic.v1 is deprecated and will soon stop being supported by FastAPI.\"\n f\" Please update the param {param_name}: {param_details.type_annotation!r}.\",\n category=FastAPIDeprecationWarning,\n stacklevel=5,\n )\n",
"old_string": " if isinstance(param_details.field, may_v1.ModelField):\n warnings.warn(\n \"pydantic.v1 is deprecated and will soon stop being supported by FastAPI.\"\n f\" Please update the param {param_name}: {param_details.type_annotation!r}.\",\n category=DeprecationWarning,\n stacklevel=5,\n )\n"
} | {"status": "ok", "filepath": "fastapi/dependencies/utils.py", "occurrences": 1, "strategy": "exact", "diff": "--- a/fastapi/dependencies/utils.py\n+++ b/fastapifull{"status": "ok", "filepath": "fastapi/dependencies/utils.py", "occurrences": 1, "strategy": "exact", "diff": "--- a/fastapi/dependencies/utils.py\n+++ b/fastapi/dependencies/utils.py\n@@ -328,7 +328,7 @@\n warnings.warn(\n \"pydantic.v1 is deprecated and will soon stop being supported by FastAPI.\"\n f\" Please update the param {param_name}: {param_details.type_annotation!r}.\",\n- category=DeprecationWarning,\n+ category=FastAPIDeprecationWarning,\n stacklevel=5,\n )\n if isinstance(\n", "is_truncated": false} |
| 11 | run_command | {
"command": "grep -rn \"category=DeprecationWarning\" fastapi | grep -v \"dependencies/utils.py\" | head -20"
} | {"status": "ok", "stdout": "fastapi/temp_pydantic_v1_params.py:66: category=DeprecationWarning,\nfastapi/temp_pydantic_v1_params.py:96: category=DeprecationWarnfull{"status": "ok", "stdout": "fastapi/temp_pydantic_v1_params.py:66: category=DeprecationWarning,\nfastapi/temp_pydantic_v1_params.py:96: category=DeprecationWarning,\nfastapi/temp_pydantic_v1_params.py:506: category=DeprecationWarning,\nfastapi/temp_pydantic_v1_params.py:536: category=DeprecationWarning,\nfastapi/routing.py:643: category=DeprecationWarning,\nfastapi/routing.py:683: category=DeprecationWarning,\nfastapi/params.py:78: category=DeprecationWarning,\nfastapi/params.py:108: category=DeprecationWarning,\nfastapi/params.py:533: category=DeprecationWarning,\nfastapi/params.py:563: category=DeprecationWarning,\n", "exit_code": 0} |
| 12 | read_file | {
"filepath": "fastapi/temp_pydantic_v1_params.py"
} | {"status": "ok", "filepath": "fastapi/temp_pydantic_v1_params.py", "content": "import warnings\nfrom typing import Annotated, Any, Callable, Optional, Union\n\nfull{"status": "ok", "filepath": "fastapi/temp_pydantic_v1_params.py", "content": "import warnings\nfrom typing import Annotated, Any, Callable, Optional, Union\n\nfrom fastapi.openapi.models import Example\nfrom fastapi.params import ParamTypes\nfrom typing_extensions import deprecated\n\nfrom ._compat.may_v1 import FieldInfo, Undefined\n\n_Unset: Any = Undefined\n\n\nclass Param(FieldInfo):\n in_: ParamTypes\n\n def __init__(\n self,\n default: Any = Undefined,\n *,\n default_factory: Union[Callable[[], Any], None] = _Unset,\n annotation: Optional[Any] = None,\n alias: Optional[str] = None,\n alias_priority: Union[int, None] = _Unset,\n # TODO: update when deprecating Pydantic v1, import these types\n # validation_alias: str | AliasPath | AliasChoices | None\n validation_alias: Union[str, None] = None,\n serialization_alias: Union[str, None] = None,\n title: Optional[str] = None,\n description: Optional[str] = None,\n gt: Optional[float] = None,\n ge: Optional[float] = None,\n lt: Optional[float] = None,\n le: Optional[float] = None,\n min_length: Optional[int] = None,\n max_length: Optional[int] = None,\n pattern: Optional[str] = None,\n regex: Annotated[\n Optional[str],\n deprecated(\n \"Deprecated in FastAPI 0.100.0 and Pydantic v2, use `pattern` instead.\"\n ),\n ] = None,\n discriminator: Union[str, None] = None,\n strict: Union[bool, None] = _Unset,\n multiple_of: Union[float, None] = _Unset,\n allow_inf_nan: Union[bool, None] = _Unset,\n max_digits: Union[int, None] = _Unset,\n decimal_places: Union[int, None] = _Unset,\n examples: Optional[list[Any]] = None,\n example: Annotated[\n Optional[Any],\n deprecated(\n \"Deprecated in OpenAPI 3.1.0 that now uses JSON Sch |
| 13 | read_file | {
"end_line": 100,
"filepath": "fastapi/temp_pydantic_v1_params.py",
"start_line": 1
} | {"status": "ok", "filepath": "fastapi/temp_pydantic_v1_params.py", "content": "import warnings\nfrom typing import Annotated, Any, Callable, Optional, Union\n\nfull{"status": "ok", "filepath": "fastapi/temp_pydantic_v1_params.py", "content": "import warnings\nfrom typing import Annotated, Any, Callable, Optional, Union\n\nfrom fastapi.openapi.models import Example\nfrom fastapi.params import ParamTypes\nfrom typing_extensions import deprecated\n\nfrom ._compat.may_v1 import FieldInfo, Undefined\n\n_Unset: Any = Undefined\n\n\nclass Param(FieldInfo):\n in_: ParamTypes\n\n def __init__(\n self,\n default: Any = Undefined,\n *,\n default_factory: Union[Callable[[], Any], None] = _Unset,\n annotation: Optional[Any] = None,\n alias: Optional[str] = None,\n alias_priority: Union[int, None] = _Unset,\n # TODO: update when deprecating Pydantic v1, import these types\n # validation_alias: str | AliasPath | AliasChoices | None\n validation_alias: Union[str, None] = None,\n serialization_alias: Union[str, None] = None,\n title: Optional[str] = None,\n description: Optional[str] = None,\n gt: Optional[float] = None,\n ge: Optional[float] = None,\n lt: Optional[float] = None,\n le: Optional[float] = None,\n min_length: Optional[int] = None,\n max_length: Optional[int] = None,\n pattern: Optional[str] = None,\n regex: Annotated[\n Optional[str],\n deprecated(\n \"Deprecated in FastAPI 0.100.0 and Pydantic v2, use `pattern` instead.\"\n ),\n ] = None,\n discriminator: Union[str, None] = None,\n strict: Union[bool, None] = _Unset,\n multiple_of: Union[float, None] = _Unset,\n allow_inf_nan: Union[bool, None] = _Unset,\n max_digits: Union[int, None] = _Unset,\n decimal_places: Union[int, None] = _Unset,\n examples: Optional[list[Any]] = None,\n example: Annotated[\n Optional[Any],\n deprecated(\n \"Deprecated in OpenAPI 3.1.0 that now uses JSON Sch |
| 14 | edit_file | {
"filepath": "fastapi/temp_pydantic_v1_params.py",
"new_string": "import warnings\nfrom typing import Annotated, Any, Callable, Optional, Union\n\nfrom fastapi.exceptions import FastAPIDeprecationWarning\nfrom fastapi.openapi.models import Example\nfrom fastapi.params import ParamTypes\nfrom typing_extensions import deprecated\n",
"old_string": "import warnings\nfrom typing import Annotated, Any, Callable, Optional, Union\n\nfrom fastapi.openapi.models import Example\nfrom fastapi.params import ParamTypes\nfrom typing_extensions import deprecated\n"
} | {"status": "ok", "filepath": "fastapi/temp_pydantic_v1_params.py", "occurrences": 1, "strategy": "exact", "diff": "--- a/fastapi/temp_pydantic_v1_params.py\n+++full{"status": "ok", "filepath": "fastapi/temp_pydantic_v1_params.py", "occurrences": 1, "strategy": "exact", "diff": "--- a/fastapi/temp_pydantic_v1_params.py\n+++ b/fastapi/temp_pydantic_v1_params.py\n@@ -1,6 +1,7 @@\n import warnings\n from typing import Annotated, Any, Callable, Optional, Union\n \n+from fastapi.exceptions import FastAPIDeprecationWarning\n from fastapi.openapi.models import Example\n from fastapi.params import ParamTypes\n from typing_extensions import deprecated\n", "is_truncated": false} |
| 15 | edit_file | {
"filepath": "fastapi/temp_pydantic_v1_params.py",
"new_string": " if example is not _Unset:\n warnings.warn(\n \"`example` has been deprecated, please use `examples` instead\",\n category=FastAPIDeprecationWarning,\n stacklevel=4,\n )\n",
"old_string": " if example is not _Unset:\n warnings.warn(\n \"`example` has been deprecated, please use `examples` instead\",\n category=DeprecationWarning,\n stacklevel=4,\n )\n"
} | {"status": "error", "error_type": "FileEditError", "error_message": "old_string matched 2 occurrences; provide more context or set allow_multiple"}full{"status": "error", "error_type": "FileEditError", "error_message": "old_string matched 2 occurrences; provide more context or set allow_multiple"} |
| 16 | edit_file | {
"filepath": "fastapi/temp_pydantic_v1_params.py",
"new_string": " if example is not _Unset:\n warnings.warn(\n \"`example` has been deprecated, please use `examples` instead\",\n category=FastAPIDeprecationWarning,\n stacklevel=4,\n )\n",
"old_string": " if example is not _Unset:\n warnings.warn(\n \"`example` has been deprecated, please use `examples` instead\",\n category=DeprecationWarning,\n stacklevel=4,\n )\n",
"allow_multiple": true
} | {"status": "ok", "filepath": "fastapi/temp_pydantic_v1_params.py", "occurrences": 2, "strategy": "exact", "diff": "--- a/fastapi/temp_pydantic_v1_params.py\n+++full{"status": "ok", "filepath": "fastapi/temp_pydantic_v1_params.py", "occurrences": 2, "strategy": "exact", "diff": "--- a/fastapi/temp_pydantic_v1_params.py\n+++ b/fastapi/temp_pydantic_v1_params.py\n@@ -64,7 +64,7 @@\n if example is not _Unset:\n warnings.warn(\n \"`example` has been deprecated, please use `examples` instead\",\n- category=DeprecationWarning,\n+ category=FastAPIDeprecationWarning,\n stacklevel=4,\n )\n self.example = example\n@@ -504,7 +504,7 @@\n if example is not _Unset:\n warnings.warn(\n \"`example` has been deprecated, please use `examples` instead\",\n- category=DeprecationWarning,\n+ category=FastAPIDeprecationWarning,\n stacklevel=4,\n )\n self.example = example\n", "is_truncated": false} |
| 17 | edit_file | {
"allow_multiple": true,
"filepath": "fastapi/temp_pydantic_v1_params.py",
"new_string": " if regex is not None:\n warnings.warn(\n \"`regex` has been deprecated, please use `pattern` instead\",\n category=FastAPIDeprecationWarning,\n stacklevel=4,\n )\n",
"old_string": " if regex is not None:\n warnings.warn(\n \"`regex` has been deprecated, please use `pattern` instead\",\n category=DeprecationWarning,\n stacklevel=4,\n )\n"
} | {"status": "ok", "filepath": "fastapi/temp_pydantic_v1_params.py", "occurrences": 2, "strategy": "exact", "diff": "--- a/fastapi/temp_pydantic_v1_params.py\n+++full{"status": "ok", "filepath": "fastapi/temp_pydantic_v1_params.py", "occurrences": 2, "strategy": "exact", "diff": "--- a/fastapi/temp_pydantic_v1_params.py\n+++ b/fastapi/temp_pydantic_v1_params.py\n@@ -94,7 +94,7 @@\n if regex is not None:\n warnings.warn(\n \"`regex` has been deprecated, please use `pattern` instead\",\n- category=DeprecationWarning,\n+ category=FastAPIDeprecationWarning,\n stacklevel=4,\n )\n current_json_schema_extra = json_schema_extra or extra\n@@ -534,7 +534,7 @@\n if regex is not None:\n warnings.warn(\n \"`regex` has been deprecated, please use `pattern` instead\",\n- category=DeprecationWarning,\n+ category=FastAPIDeprecationWarning,\n stacklevel=4,\n )\n current_json_schema_extra = json_schema_extra or extra\n", "is_truncated": false} |
| 18 | run_command | {
"command": "grep -rn \"category=DeprecationWarning\" fastapi | grep -v \"temp_pydantic_v1_params.py\" | grep -v \"dependencies/utils.py\" | head -20"
} | {"status": "ok", "stdout": "fastapi/routing.py:643: category=DeprecationWarning,\nfastapi/routing.py:683: category=DeprecationWarning,\nfastapi/params.py:78: cafull{"status": "ok", "stdout": "fastapi/routing.py:643: category=DeprecationWarning,\nfastapi/routing.py:683: category=DeprecationWarning,\nfastapi/params.py:78: category=DeprecationWarning,\nfastapi/params.py:108: category=DeprecationWarning,\nfastapi/params.py:533: category=DeprecationWarning,\nfastapi/params.py:563: category=DeprecationWarning,\n", "exit_code": 0} |
| 19 | read_file | {
"end_line": 650,
"filepath": "fastapi/routing.py",
"start_line": 630
} | {"status": "ok", "filepath": "fastapi/routing.py", "content": " # normalize enums e.g. http.HTTPStatus\n if isinstance(status_code, IntEnum):\n status_code = infull{"status": "ok", "filepath": "fastapi/routing.py", "content": " # normalize enums e.g. http.HTTPStatus\n if isinstance(status_code, IntEnum):\n status_code = int(status_code)\n self.status_code = status_code\n if self.response_model:\n assert is_body_allowed_for_status_code(status_code), (\n f\"Status code {status_code} must not have a response body\"\n )\n response_name = \"Response_\" + self.unique_id\n if annotation_is_pydantic_v1(self.response_model):\n warnings.warn(\n \"pydantic.v1 is deprecated and will soon stop being supported by FastAPI.\"\n f\" Please update the response model {self.response_model!r}.\",\n category=DeprecationWarning,\n stacklevel=4,\n )\n self.response_field = create_model_field(\n name=response_name,\n type_=self.response_model,\n mode=\"serialization\",\n )\n", "start_line": 630, "end_line": 650, "total_lines": 4583, "is_truncated": false} |
| 20 | edit_file | {
"filepath": "fastapi/routing.py",
"new_string": "from fastapi import params\nfrom fastapi.exceptions import FastAPIDeprecationWarning\nfrom fastapi._compat import (\n",
"old_string": "from fastapi import params\nfrom fastapi._compat import (\n"
} | {"status": "error", "error_type": "FileEditError", "error_message": "old_string not found in file (tried exact, flexible and regex matching)"}full{"status": "error", "error_type": "FileEditError", "error_message": "old_string not found in file (tried exact, flexible and regex matching)"} |
| 21 | read_file | {
"end_line": 50,
"filepath": "fastapi/routing.py",
"start_line": 1
} | {"status": "ok", "filepath": "fastapi/routing.py", "content": "import email.message\nimport functools\nimport inspect\nimport json\nimport warnings\nfrom collecfull{"status": "ok", "filepath": "fastapi/routing.py", "content": "import email.message\nimport functools\nimport inspect\nimport json\nimport warnings\nfrom collections.abc import (\n AsyncIterator,\n Awaitable,\n Collection,\n Coroutine,\n Mapping,\n Sequence,\n)\nfrom contextlib import AsyncExitStack, asynccontextmanager\nfrom enum import Enum, IntEnum\nfrom typing import (\n Annotated,\n Any,\n Callable,\n Optional,\n Union,\n)\n\nfrom annotated_doc import Doc\nfrom fastapi import params, temp_pydantic_v1_params\nfrom fastapi._compat import (\n ModelField,\n Undefined,\n _get_model_config,\n _model_dump,\n _normalize_errors,\n annotation_is_pydantic_v1,\n lenient_issubclass,\n may_v1,\n)\nfrom fastapi.datastructures import Default, DefaultPlaceholder\nfrom fastapi.dependencies.models import Dependant\nfrom fastapi.dependencies.utils import (\n _should_embed_body_fields,\n get_body_field,\n get_dependant,\n get_flat_dependant,\n get_parameterless_sub_dependant,\n get_typed_return_annotation,\n solve_dependencies,\n)\nfrom fastapi.encoders import jsonable_encoder\nfrom fastapi.exceptions import (\n EndpointContext,\n FastAPIError,\n", "start_line": 1, "end_line": 50, "total_lines": 4583, "is_truncated": false} |
| 22 | edit_file | {
"filepath": "fastapi/routing.py",
"new_string": "fromfrom fastapi.exceptions import (\n EndpointContext,\n FastAPIError,\n FastAPIDeprecationWarning,\n)\n",
"old_string": "from fastapi.exceptions import (\n EndpointContext,\n FastAPIError,\n)\n"
} | {"status": "error", "error_type": "FileEditError", "error_message": "old_string not found in file (tried exact, flexible and regex matching)"}full{"status": "error", "error_type": "FileEditError", "error_message": "old_string not found in file (tried exact, flexible and regex matching)"} |
| 23 | edit_file | {
"filepath": "fastapi/routing.py",
"new_string": "from fastapi.exceptions import (\n EndpointContext,\n FastAPIError,\n FastAPIDeprecationWarning,\n)\n",
"old_string": "from fastapi.exceptions import (\n EndpointContext,\n FastAPIError,\n)\n"
} | {"status": "error", "error_type": "FileEditError", "error_message": "old_string not found in file (tried exact, flexible and regex matching)"}full{"status": "error", "error_type": "FileEditError", "error_message": "old_string not found in file (tried exact, flexible and regex matching)"} |
| 24 | read_file | {
"end_line": 50,
"filepath": "fastapi/routing.py",
"start_line": 40
} | {"status": "ok", "filepath": "fastapi/routing.py", "content": " get_body_field,\n get_dependant,\n get_flat_dependant,\n get_parameterless_sub_dependant,\n get_full{"status": "ok", "filepath": "fastapi/routing.py", "content": " get_body_field,\n get_dependant,\n get_flat_dependant,\n get_parameterless_sub_dependant,\n get_typed_return_annotation,\n solve_dependencies,\n)\nfrom fastapi.encoders import jsonable_encoder\nfrom fastapi.exceptions import (\n EndpointContext,\n FastAPIError,\n", "start_line": 40, "end_line": 50, "total_lines": 4583, "is_truncated": false} |
| 25 | edit_file | {
"filepath": "fastapi/routing.py",
"new_string": "from fastapi.exceptions import (\n EndpointContext,\n FastAPIError,\n FastAPIDeprecationWarning,\n)\n",
"old_string": "from fastapi.exceptions import (\n EndpointContext,\n FastAPIError,\n)\n"
} | {"status": "error", "error_type": "FileEditError", "error_message": "old_string not found in file (tried exact, flexible and regex matching)"}full{"status": "error", "error_type": "FileEditError", "error_message": "old_string not found in file (tried exact, flexible and regex matching)"} |
| 26 | read_file | {
"end_line": 55,
"filepath": "fastapi/routing.py",
"start_line": 45
} | {"status": "ok", "filepath": "fastapi/routing.py", "content": " solve_dependencies,\n)\nfrom fastapi.encoders import jsonable_encoder\nfrom fastapi.exceptions ifull{"status": "ok", "filepath": "fastapi/routing.py", "content": " solve_dependencies,\n)\nfrom fastapi.encoders import jsonable_encoder\nfrom fastapi.exceptions import (\n EndpointContext,\n FastAPIError,\n RequestValidationError,\n ResponseValidationError,\n WebSocketRequestValidationError,\n)\nfrom fastapi.types import DecoratedCallable, IncEx\n", "start_line": 45, "end_line": 55, "total_lines": 4583, "is_truncated": false} |
| 27 | edit_file | {
"filepath": "fastapi/routing.py",
"new_string": "from fastapi.exceptions import (\n EndpointContext,\n FastAPIError,\n FastAPIDeprecationWarning,\n RequestValidationError,\n ResponseValidationError,\n WebSocketRequestValidationError,\n)\n",
"old_string": "from fastapi.exceptions import (\n EndpointContext,\n FastAPIError,\n RequestValidationError,\n ResponseValidationError,\n WebSocketRequestValidationError,\n)\n"
} | {"status": "ok", "filepath": "fastapi/routing.py", "occurrences": 1, "strategy": "exact", "diff": "--- a/fastapi/routing.py\n+++ b/fastapi/routing.py\n@@ -48,6 full{"status": "ok", "filepath": "fastapi/routing.py", "occurrences": 1, "strategy": "exact", "diff": "--- a/fastapi/routing.py\n+++ b/fastapi/routing.py\n@@ -48,6 +48,7 @@\n from fastapi.exceptions import (\n EndpointContext,\n FastAPIError,\n+ FastAPIDeprecationWarning,\n RequestValidationError,\n ResponseValidationError,\n WebSocketRequestValidationError,\n", "is_truncated": false} |
| 28 | edit_file | {
"allow_multiple": true,
"filepath": "fastapi/routing.py",
"new_string": " category=FastAPIDeprecationWarning,\n",
"old_string": " category=DeprecationWarning,\n"
} | {"status": "ok", "filepath": "fastapi/routing.py", "occurrences": 2, "strategy": "exact", "diff": "--- a/fastapi/routing.py\n+++ b/fastapi/routing.py\n@@ -641,7full{"status": "ok", "filepath": "fastapi/routing.py", "occurrences": 2, "strategy": "exact", "diff": "--- a/fastapi/routing.py\n+++ b/fastapi/routing.py\n@@ -641,7 +641,7 @@\n warnings.warn(\n \"pydantic.v1 is deprecated and will soon stop being supported by FastAPI.\"\n f\" Please update the response model {self.response_model!r}.\",\n- category=DeprecationWarning,\n+ category=FastAPIDeprecationWarning,\n stacklevel=4,\n )\n self.response_field = create_model_field(\n@@ -681,7 +681,7 @@\n warnings.warn(\n \"pydantic.v1 is deprecated and will soon stop being supported by FastAPI.\"\n f\" In responses={{}}, please update {model}.\",\n- category=DeprecationWarning,\n+ category=FastAPIDeprecationWarning,\n stacklevel=4,\n )\n response_field = create_model_field(\n", "is_truncated": false} |
| 29 | read_file | {
"end_line": 120,
"filepath": "fastapi/params.py",
"start_line": 1
} | {"status": "ok", "filepath": "fastapi/params.py", "content": "import warnings\nfrom collections.abc import Sequence\nfrom dataclasses import dataclass\nfrom enufull{"status": "ok", "filepath": "fastapi/params.py", "content": "import warnings\nfrom collections.abc import Sequence\nfrom dataclasses import dataclass\nfrom enum import Enum\nfrom typing import Annotated, Any, Callable, Optional, Union\n\nfrom fastapi.openapi.models import Example\nfrom pydantic.fields import FieldInfo\nfrom typing_extensions import Literal, deprecated\n\nfrom ._compat import (\n Undefined,\n)\n\n_Unset: Any = Undefined\n\n\nclass ParamTypes(Enum):\n query = \"query\"\n header = \"header\"\n path = \"path\"\n cookie = \"cookie\"\n\n\nclass Param(FieldInfo): # type: ignore[misc]\n in_: ParamTypes\n\n def __init__(\n self,\n default: Any = Undefined,\n *,\n default_factory: Union[Callable[[], Any], None] = _Unset,\n annotation: Optional[Any] = None,\n alias: Optional[str] = None,\n alias_priority: Union[int, None] = _Unset,\n # TODO: update when deprecating Pydantic v1, import these types\n # validation_alias: str | AliasPath | AliasChoices | None\n validation_alias: Union[str, None] = None,\n serialization_alias: Union[str, None] = None,\n title: Optional[str] = None,\n description: Optional[str] = None,\n gt: Optional[float] = None,\n ge: Optional[float] = None,\n lt: Optional[float] = None,\n le: Optional[float] = None,\n min_length: Optional[int] = None,\n max_length: Optional[int] = None,\n pattern: Optional[str] = None,\n regex: Annotated[\n Optional[str],\n deprecated(\n \"Deprecated in FastAPI 0.100.0 and Pydantic v2, use `pattern` instead.\"\n ),\n ] = None,\n discriminator: Union[str, None] = None,\n strict: Union[bool, None] = _Unset,\n multiple_of: Union[float, None] = _Unset,\n allow_inf_nan: Union[bool, None] = _Unset,\n max_digits: Union[int, None] = _Unset,\n decimal_places: |
| 30 | edit_file | {
"filepath": "fastapi/params.py",
"new_string": "import warnings\nfrom collections.abc import Sequence\nfrom dataclasses import dataclass\nfrom enum import Enum\nfrom typing import Annotated, Any, Callable, Optional, Union\n\nfrom fastapi.exceptions import FastAPIDeprecationWarning\nfrom fastapi.openapi.models import Example\nfrom pydantic.fields import FieldInfo\nfrom typing_extensions import Literal, deprecated\n",
"old_string": "import warnings\nfrom collections.abc import Sequence\nfrom dataclasses import dataclass\nfrom enum import Enum\nfrom typing import Annotated, Any, Callable, Optional, Union\n\nfrom fastapi.openapi.models import Example\nfrom pydantic.fields import FieldInfo\nfrom typing_extensions import Literal, deprecated\n"
} | {"status": "ok", "filepath": "fastapi/params.py", "occurrences": 1, "strategy": "exact", "diff": "--- a/fastapi/params.py\n+++ b/fastapi/params.py\n@@ -4,6 +4,7full{"status": "ok", "filepath": "fastapi/params.py", "occurrences": 1, "strategy": "exact", "diff": "--- a/fastapi/params.py\n+++ b/fastapi/params.py\n@@ -4,6 +4,7 @@\n from enum import Enum\n from typing import Annotated, Any, Callable, Optional, Union\n \n+from fastapi.exceptions import FastAPIDeprecationWarning\n from fastapi.openapi.models import Example\n from pydantic.fields import FieldInfo\n from typing_extensions import Literal, deprecated\n", "is_truncated": false} |
| 31 | edit_file | {
"allow_multiple": true,
"filepath": "fastapi/params.py",
"new_string": " category=FastAPIDeprecationWarning,\n",
"old_string": " category=DeprecationWarning,\n"
} | {"status": "ok", "filepath": "fastapi/params.py", "occurrences": 4, "strategy": "exact", "diff": "--- a/fastapi/params.py\n+++ b/fastapi/params.py\n@@ -76,7 +76full{"status": "ok", "filepath": "fastapi/params.py", "occurrences": 4, "strategy": "exact", "diff": "--- a/fastapi/params.py\n+++ b/fastapi/params.py\n@@ -76,7 +76,7 @@\n if example is not _Unset:\n warnings.warn(\n \"`example` has been deprecated, please use `examples` instead\",\n- category=DeprecationWarning,\n+ category=FastAPIDeprecationWarning,\n stacklevel=4,\n )\n self.example = example\n@@ -106,7 +106,7 @@\n if regex is not None:\n warnings.warn(\n \"`regex` has been deprecated, please use `pattern` instead\",\n- category=DeprecationWarning,\n+ category=FastAPIDeprecationWarning,\n stacklevel=4,\n )\n current_json_schema_extra = json_schema_extra or extra\n@@ -531,7 +531,7 @@\n if example is not _Unset:\n warnings.warn(\n \"`example` has been deprecated, please use `examples` instead\",\n- category=DeprecationWarning,\n+ category=FastAPIDeprecationWarning,\n stacklevel=4,\n )\n self.example = example\n@@ -561,7 +561,7 @@\n if regex is not None:\n warnings.warn(\n \"`regex` has been deprecated, please use `pattern` instead\",\n- category=DeprecationWarning,\n+ category=FastAPIDeprecationWarning,\n stacklevel=4,\n )\n current_json_schema_extra = json_schema_extra or extra\n", "is_truncated": false} |
| 32 | run_command | {
"command": "grep -rn \"category=DeprecationWarning\" fastapi"
} | {"status": "error", "error_type": "CommandError", "error_message": "Command failed with exit code 1", "details": {"stdout": "", "stderr": "", "exit_code": 1}}full{"status": "error", "error_type": "CommandError", "error_message": "Command failed with exit code 1", "details": {"stdout": "", "stderr": "", "exit_code": 1}} |
| 33 | submit_patch | [] | {"status": "ok", "patch_size": 6756, "files_changed": 5}full{"status": "ok", "patch_size": 6756, "files_changed": 5} |
diff --git a/fastapi/dependencies/utils.py b/fastapi/dependencies/utils.py
index 39d0bd89..dc951a70 100644
--- a/fastapi/dependencies/utils.py
+++ b/fastapi/dependencies/utils.py
@@ -18,6 +18,7 @@ from typing import (
import anyio
from fastapi import params
+from fastapi.exceptions import FastAPIDeprecationWarning
from fastapi._compat import (
ModelField,
RequiredParam,
@@ -327,7 +328,7 @@ def get_dependant(
warnings.warn(
"pydantic.v1 is deprecated and will soon stop being supported by FastAPI."
f" Please update the param {param_name}: {param_details.type_annotation!r}.",
- category=DeprecationWarning,
+ category=FastAPIDeprecationWarning,
stacklevel=5,
)
if isinstance(
diff --git a/fastapi/exceptions.py b/fastapi/exceptions.py
index 8e0c5590..179e8fba 100644
--- a/fastapi/exceptions.py
+++ b/fastapi/exceptions.py
@@ -7,6 +7,12 @@ from starlette.exceptions import HTTPException as StarletteHTTPException
from starlette.exceptions import WebSocketException as StarletteWebSocketException
+class FastAPIDeprecationWarning(DeprecationWarning):
+ \"\"\"
+ A custom deprecation warning for FastAPI.
+ \"\"\"
+
+
class EndpointContext(TypedDict, total=False):
function: str
path: str
diff --git a/fastapi/params.py b/fastapi/params.py
index c776c4a5..cc2934f4 100644
--- a/fastapi/params.py
+++ b/fastapi/params.py
@@ -4,6 +4,7 @@ from dataclasses import dataclass
from enum import Enum
from typing import Annotated, Any, Callable, Optional, Union
+from fastapi.exceptions import FastAPIDeprecationWarning
from fastapi.openapi.models import Example
from pydantic.fields import FieldInfo
from typing_extensions import Literal, deprecated
@@ -75,7 +76,7 @@ class Param(FieldInfo): # type: ignore[misc]
if example is not _Unset:
warnings.warn(
"`example` has been deprecated, please use `examples` instead",
- category=DeprecationWarning,
+ category=FastAPIDeprecationWarning,
stacklevel=4,
)
self.example = example
@@ -105,7 +106,7 @@ class Param(FieldInfo): # type: ignore[misc]
if regex is not None:
warnings.warn(
"`regex` has been deprecated, please use `pattern` instead",
- category=DeprecationWarning,
+ category=FastAPIDeprecationWarning,
stacklevel=4,
)
current_json_schema_extra = json_schema_extra or extra
@@ -530,7 +531,7 @@ class Body(FieldInfo): # type: ignore[misc]
if example is not _Unset:
warnings.warn(
"`example` has been deprecated, please use `examples` instead",
- category=DeprecationWarning,
+ category=FastAPIDeprecationWarning,
stacklevel=4,
)
self.example = example
@@ -560,7 +561,7 @@ class Body(FieldInfo): # type: ignore[misc]
if regex is not None:
warnings.warn(
"`regex` has been deprecated, please use `pattern` instead",
- category=DeprecationWarning,
+ category=FastAPIDeprecationWarning,
stacklevel=4,
)
current_json_schema_extra = json_schema_extra or extra
diff --git a/fastapi/routing.py b/fastapi/routing.py
index 2770e325..44207200 100644
--- a/fastapi/routing.py
+++ b/fastapi/routing.py
@@ -48,6 +48,7 @@ from fastapi.encoders import jsonable_encoder
from fastapi.exceptions import (
EndpointContext,
FastAPIError,
+ FastAPIDeprecationWarning,
RequestValidationError,
ResponseValidationError,
WebSocketRequestValidationError,
@@ -640,7 +641,7 @@ class APIRoute(routing.Route):
warnings.warn(
"pydantic.v1 is deprecated and will soon stop being supported by FastAPI."
f" Please update the response model {self.response_model!r}.",
- category=DeprecationWarning,
+ category=FastAPIDeprecationWarning,
stacklevel=4,
)
self.response_field = create_model_field(
@@ -680,7 +681,7 @@ class APIRoute(routing.Route):
warnings.warn(
"pydantic.v1 is deprecated and will soon stop being supported by FastAPI."
f" In responses={{}}, please update {model}.",
- category=DeprecationWarning,
+ category=FastAPIDeprecationWarning,
stacklevel=4,
)
response_field = create_model_field(
diff --git a/fastapi/temp_pydantic_v1_params.py b/fastapi/temp_pydantic_v1_params.py
index 1bda0ea9..62230e42 100644
--- a/fastapi/temp_pydantic_v1_params.py
+++ b/fastapi/temp_pydantic_v1_params.py
@@ -1,6 +1,7 @@
import warnings
from typing import Annotated, Any, Callable, Optional, Union
+from fastapi.exceptions import FastAPIDeprecationWarning
from fastapi.openapi.models import Example
from fastapi.params import ParamTypes
from typing_extensions import deprecated
@@ -63,7 +64,7 @@ class Param(FieldInfo):
if example is not _Unset:
warnings.warn(
"`example` has been deprecated, please use `examples` instead",
- category=DeprecationWarning,
+ category=FastAPIDeprecationWarning,
stacklevel=4,
)
self.example = example
@@ -93,7 +94,7 @@ class Param(FieldInfo):
if regex is not None:
warnings.warn(
"`regex` has been deprecated, please use `pattern` instead",
- category=DeprecationWarning,
+ category=FastAPIDeprecationWarning,
stacklevel=4,
)
current_json_schema_extra = json_schema_extra or extra
@@ -503,7 +504,7 @@ class Body(FieldInfo):
if example is not _Unset:
warnings.warn(
"`example` has been deprecated, please use `examples` instead",
- category=DeprecationWarning,
+ category=FastAPIDeprecationWarning,
stacklevel=4,
)
self.example = example
@@ -533,7 +534,7 @@ class Body(FieldInfo):
if regex is not None:
warnings.warn(
"`regex` has been deprecated, please use `pattern` instead",
- category=DeprecationWarning,
+ category=FastAPIDeprecationWarning,
stacklevel=4,
)
current_json_schema_extra = json_schema_extra or extra
==================================== ERRORS ====================================
________ ERROR collecting tests/benchmarks/test_general_performance.py _________
/kaggle/tmp/envs/fastapi/lib/python3.13/site-packages/_pytest/python.py:508: in importtestmodule
mod = import_path(
/kaggle/tmp/envs/fastapi/lib/python3.13/site-packages/_pytest/pathlib.py:596: in import_path
importlib.import_module(module_name)
/root/.local/share/uv/python/cpython-3.13.14-linux-x86_64-gnu/lib/python3.13/importlib/__init__.py:88: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<frozen importlib._bootstrap>:1395: in _gcd_import
???
<frozen importlib._bootstrap>:1360: in _find_and_load
???
<frozen importlib._bootstrap>:1331: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:935: in _load_unlocked
???
/kaggle/tmp/envs/fastapi/lib/python3.13/site-packages/_pytest/assertion/rewrite.py:188: in exec_module
exec(co, module.__dict__)
tests/benchmarks/test_general_performance.py:8: in <module>
from fastapi import Depends, FastAPI
fastapi/__init__.py:7: in <module>
from .applications import FastAPI as FastAPI
fastapi/applications.py:13: in <module>
from fastapi import routing
fastapi/routing.py:25: in <module>
from fastapi import params, temp_pydantic_v1_params
fastapi/params.py:7: in <module>
from fastapi.exceptions import FastAPIDeprecationWarning
E File "/tmp/swe_work/eval_submission_nothink/fastapi_14605/b/workspace/fastapi/exceptions.py", line 11
E \"\"\"
E ^
E SyntaxError: unexpected character after line continuation character
!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!
1 error in 0.42s