mirror of https://github.com/tiangolo/fastapi.git
Remove code examples for Python 3.8 in `extra_data_types`
This commit is contained in:
parent
bdb6756f38
commit
4603f23b79
|
|
@ -1,29 +0,0 @@
|
|||
from datetime import datetime, time, timedelta
|
||||
from typing import Union
|
||||
from uuid import UUID
|
||||
|
||||
from fastapi import Body, FastAPI
|
||||
from typing_extensions import Annotated
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
|
||||
@app.put("/items/{item_id}")
|
||||
async def read_items(
|
||||
item_id: UUID,
|
||||
start_datetime: Annotated[datetime, Body()],
|
||||
end_datetime: Annotated[datetime, Body()],
|
||||
process_after: Annotated[timedelta, Body()],
|
||||
repeat_at: Annotated[Union[time, None], Body()] = None,
|
||||
):
|
||||
start_process = start_datetime + process_after
|
||||
duration = end_datetime - start_process
|
||||
return {
|
||||
"item_id": item_id,
|
||||
"start_datetime": start_datetime,
|
||||
"end_datetime": end_datetime,
|
||||
"process_after": process_after,
|
||||
"repeat_at": repeat_at,
|
||||
"start_process": start_process,
|
||||
"duration": duration,
|
||||
}
|
||||
|
|
@ -4,16 +4,15 @@ import pytest
|
|||
from dirty_equals import IsDict
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
from ...utils import needs_py39, needs_py310
|
||||
from ...utils import needs_py310
|
||||
|
||||
|
||||
@pytest.fixture(
|
||||
name="client",
|
||||
params=[
|
||||
"tutorial001",
|
||||
pytest.param("tutorial001_py39"),
|
||||
pytest.param("tutorial001_py310", marks=needs_py310),
|
||||
"tutorial001_an",
|
||||
pytest.param("tutorial001_an_py39", marks=needs_py39),
|
||||
pytest.param("tutorial001_an_py39"),
|
||||
pytest.param("tutorial001_an_py310", marks=needs_py310),
|
||||
],
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue