Skip to content

Commit

Permalink
🚨 Upgrade list types
Browse files Browse the repository at this point in the history
  • Loading branch information
rafalkrupinski committed Jan 3, 2025
1 parent 7528cba commit 4f46804
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ async def cat_list(request: Request) -> JSONResponse:
return_list = request.headers.get('return-list', 'false') == 'True'
token = request.headers.get('token')

serializer = pydantic.TypeAdapter(typing.List[Cat])
serializer = pydantic.TypeAdapter(list[Cat])
data = [Cat(id=1, name='Tom')]
headers = {
'X-Count': str(len(data)),
Expand Down
8 changes: 4 additions & 4 deletions tests/test_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class MyRequestBodyModel(pydantic.BaseModel):


class MyRequestBodyList(pydantic.RootModel):
root: typing.List[MyRequestBodyModel]
root: list[MyRequestBodyModel]


@pytest_asyncio.fixture(scope='function')
Expand Down Expand Up @@ -66,7 +66,7 @@ class Client(ClientTestBase):
@get('/param_list_simple')
async def param_list_simple(
self: typing.Self,
q_a: typing.Annotated[typing.List[str], Query('a', style=SimpleMultimap)],
q_a: typing.Annotated[list[str], Query('a', style=SimpleMultimap)],
) -> typing.Annotated[Awaitable[None], Responses({})]:
pass

Expand Down Expand Up @@ -113,7 +113,7 @@ class Client(ClientTestBase):
@get('/param_list_exploded')
async def param_list_exploded(
self: typing.Self,
q_a: typing.Annotated[typing.List[str], Query('a', style=SimpleMultimap)],
q_a: typing.Annotated[list[str], Query('a', style=SimpleMultimap)],
) -> typing.Annotated[Awaitable[None], Responses({})]:
pass

Expand All @@ -137,7 +137,7 @@ class Client(ClientTestBase):
@get('/param_list_exploded')
async def op(
self: typing.Self,
q_a: typing.Annotated[typing.List[str], Query],
q_a: typing.Annotated[list[str], Query],
) -> typing.Annotated[Awaitable[None], Responses({})]:
pass

Expand Down

0 comments on commit 4f46804

Please sign in to comment.