Apply automatic linting fixes to tests directory

Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
Devin AI
2025-05-12 13:31:07 +00:00
parent ad1ea46bbb
commit 46621113af
62 changed files with 1738 additions and 1821 deletions

View File

@@ -1,12 +1,10 @@
from typing import Any, Dict, List, Optional, Set, Tuple, Union
import pytest
from pydantic import BaseModel, Field
from pydantic import BaseModel
from crewai.utilities.pydantic_schema_parser import PydanticSchemaParser
def test_simple_model():
def test_simple_model() -> None:
class SimpleModel(BaseModel):
field1: int
field2: str
@@ -21,7 +19,7 @@ def test_simple_model():
assert schema.strip() == expected_schema.strip()
def test_nested_model():
def test_nested_model() -> None:
class NestedModel(BaseModel):
nested_field: int
@@ -42,9 +40,9 @@ def test_nested_model():
assert schema.strip() == expected_schema.strip()
def test_model_with_list():
def test_model_with_list() -> None:
class ListModel(BaseModel):
list_field: List[int]
list_field: list[int]
parser = PydanticSchemaParser(model=ListModel)
schema = parser.get_schema()
@@ -55,9 +53,9 @@ def test_model_with_list():
assert schema.strip() == expected_schema.strip()
def test_model_with_optional_field():
def test_model_with_optional_field() -> None:
class OptionalModel(BaseModel):
optional_field: Optional[str]
optional_field: str | None
parser = PydanticSchemaParser(model=OptionalModel)
schema = parser.get_schema()
@@ -68,9 +66,9 @@ def test_model_with_optional_field():
assert schema.strip() == expected_schema.strip()
def test_model_with_union():
def test_model_with_union() -> None:
class UnionModel(BaseModel):
union_field: Union[int, str]
union_field: int | str
parser = PydanticSchemaParser(model=UnionModel)
schema = parser.get_schema()
@@ -81,9 +79,9 @@ def test_model_with_union():
assert schema.strip() == expected_schema.strip()
def test_model_with_dict():
def test_model_with_dict() -> None:
class DictModel(BaseModel):
dict_field: Dict[str, int]
dict_field: dict[str, int]
parser = PydanticSchemaParser(model=DictModel)
schema = parser.get_schema()