Skip to content

Commit a010753

Browse files
Using generics types + removing old code + fixing stuff
1 parent e8ac6ec commit a010753

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

tests/functional/event_handler/_pydantic/test_bedrock_agent.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
from __future__ import annotations
2-
31
import json
4-
from typing import Any
2+
from typing import Any, Dict, Optional
53

64
import pytest
75
from typing_extensions import Annotated
@@ -19,7 +17,7 @@ def test_bedrock_agent_event():
1917
app = BedrockAgentResolver()
2018

2119
@app.get("/claims", description="Gets claims")
22-
def claims() -> dict[str, Any]:
20+
def claims() -> Dict[str, Any]:
2321
assert isinstance(app.current_event, BedrockAgentEvent)
2422
assert app.lambda_context == {}
2523
return {"output": claims_response}
@@ -112,7 +110,7 @@ def test_bedrock_agent_event_with_validation_error():
112110
app = BedrockAgentResolver()
113111

114112
@app.get("/claims", description="Gets claims")
115-
def claims() -> dict[str, Any]:
113+
def claims() -> Dict[str, Any]:
116114
return "oh no, this is not a dict" # type: ignore
117115

118116
# WHEN calling the event handler
@@ -193,7 +191,7 @@ def test_openapi_schema_for_pydanticv2(openapi30_schema):
193191

194192
# WHEN we have a simple handler
195193
@app.get("/", description="Testing")
196-
def handler() -> dict | None:
194+
def handler() -> Optional[Dict]:
197195
pass
198196

199197
# WHEN we get the schema

0 commit comments

Comments
 (0)