mirror of https://github.com/tiangolo/fastapi.git
Remove code examples for Python 3.8 in `header_params`
This commit is contained in:
parent
e3ae463424
commit
72f7481ce0
|
|
@ -1,11 +0,0 @@
|
|||
from typing import Union
|
||||
|
||||
from fastapi import FastAPI, Header
|
||||
from typing_extensions import Annotated
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
|
||||
@app.get("/items/")
|
||||
async def read_items(user_agent: Annotated[Union[str, None], Header()] = None):
|
||||
return {"User-Agent": user_agent}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
from typing import Union
|
||||
|
||||
from fastapi import FastAPI, Header
|
||||
from typing_extensions import Annotated
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
|
||||
@app.get("/items/")
|
||||
async def read_items(
|
||||
strange_header: Annotated[
|
||||
Union[str, None], Header(convert_underscores=False)
|
||||
] = None,
|
||||
):
|
||||
return {"strange_header": strange_header}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
from typing import List, Union
|
||||
|
||||
from fastapi import FastAPI, Header
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
|
||||
@app.get("/items/")
|
||||
async def read_items(x_token: Union[List[str], None] = Header(default=None)):
|
||||
return {"X-Token values": x_token}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
from typing import List, Union
|
||||
|
||||
from fastapi import FastAPI, Header
|
||||
from typing_extensions import Annotated
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
|
||||
@app.get("/items/")
|
||||
async def read_items(x_token: Annotated[Union[List[str], None], Header()] = None):
|
||||
return {"X-Token values": x_token}
|
||||
|
|
@ -10,9 +10,9 @@ 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"),
|
||||
pytest.param("tutorial001_an_py310", marks=needs_py310),
|
||||
],
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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=[
|
||||
"tutorial002",
|
||||
pytest.param("tutorial002_py39"),
|
||||
pytest.param("tutorial002_py310", marks=needs_py310),
|
||||
"tutorial002_an",
|
||||
pytest.param("tutorial002_an_py39", marks=needs_py39),
|
||||
pytest.param("tutorial002_an_py39"),
|
||||
pytest.param("tutorial002_an_py310", marks=needs_py310),
|
||||
],
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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=[
|
||||
"tutorial003",
|
||||
pytest.param("tutorial003_py39"),
|
||||
pytest.param("tutorial003_py310", marks=needs_py310),
|
||||
"tutorial003_an",
|
||||
pytest.param("tutorial003_an_py39", marks=needs_py39),
|
||||
pytest.param("tutorial003_an_py39"),
|
||||
pytest.param("tutorial003_an_py310", marks=needs_py310),
|
||||
],
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue