Skip to content

Commit 4911ec8

Browse files
committed
test fix
1 parent 89ae595 commit 4911ec8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/test_gpt_function.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from gpt_function_decorator import gpt_function
22
from pydantic import BaseModel, Field
3+
from typing import List
34

45

56
def test_interpolated_docstring():
@@ -28,7 +29,7 @@ def positivity(sentence) -> int:
2829

2930
def test_list_of_str_output():
3031
@gpt_function
31-
def list_famous_composers(n) -> list[str]:
32+
def list_famous_composers(n) -> List[str]:
3233
"Return the {n} most famous composers."
3334

3435
assert len(list_famous_composers(2)) == 2
@@ -40,7 +41,7 @@ class USPresident(BaseModel):
4041
name: str
4142

4243
@gpt_function
43-
def first_us_presidents(n) -> list[USPresident]:
44+
def first_us_presidents(n) -> List[USPresident]:
4445
"""Return the {n} first US presidents with their birth year"""
4546

4647
assert first_us_presidents(1)[0].birth_year == 1732
@@ -52,7 +53,7 @@ class USPresident(BaseModel):
5253
name: str = Field(description="Family name")
5354

5455
@gpt_function
55-
def first_us_presidents(n) -> list[USPresident]:
56+
def first_us_presidents(n) -> List[USPresident]:
5657
"""Return the {n} first US presidents with their birth year"""
5758

5859
assert first_us_presidents(1)[0].name == "Washington"
@@ -73,7 +74,7 @@ def from_description(description) -> "Car":
7374

7475
def test_reasoned_answer():
7576
@gpt_function
76-
def could_have_met(person: str, celebrities: list) -> list[str]:
77+
def could_have_met(person: str, celebrities: list) -> List[str]:
7778
"""List the names in {celebrities} that {person} could have met."""
7879

7980
answer = could_have_met(

0 commit comments

Comments
 (0)