Browse Source

🔇 Add filter warnings for benchmark tests

pull/14583/head
Sebastián Ramírez 7 months ago
parent
commit
05bd28cfc1
  1. 8
      tests/benchmarks/test_general_performance.py

8
tests/benchmarks/test_general_performance.py

@ -1,5 +1,6 @@
import json
import sys
import warnings
from collections.abc import Iterator
from typing import Annotated, Any
@ -84,6 +85,13 @@ def app(basemodel_class: type[Any]) -> FastAPI:
app = FastAPI()
with warnings.catch_warnings(record=True):
warnings.filterwarnings(
"ignore",
message=r"pydantic\.v1 is deprecated and will soon stop being supported by FastAPI\..*",
category=DeprecationWarning,
)
@app.post("/sync/validated", response_model=ItemOut)
def sync_validated(item: ItemIn, dep: Annotated[int, Depends(dep_b)]):
return ItemOut(name=item.name, value=item.value, dep=dep)

Loading…
Cancel
Save