Skip to content

Commit

Permalink
fix failing test under 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
Viicos committed Sep 20, 2023
1 parent 1cc828b commit cd9ad99
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_docs_extraction.py
Expand Up @@ -70,7 +70,7 @@ class ModelDCNoDocs:


def test_dataclass_docs_extraction():
@pydantic_dataclass(config=ConfigDict(use_attributes_docstring=True), kw_only=True)
@pydantic_dataclass(config=ConfigDict(use_attributes_docstring=True))
class ModelDCDocs:
a: int
"""A docs"""
Expand All @@ -80,26 +80,26 @@ class ModelDCDocs:
c: int = 1
# This isn't used as a description.

d: int
d: int = 1

def dummy_method(self) -> None:
"""Docs for dummy_method that won't be used for d"""

e: int = Field(1, description='Real description')
"""Won't be used"""

f: int
f: int = 1
"""F docs"""

"""Useless docs"""

g: int
g: int = 1
"""G docs"""

h = 1
"""H docs"""

i: Annotated[int, Field(description='Real description')]
i: Annotated[int, Field(description='Real description')] = 1
"""Won't be used"""

assert ModelDCDocs.__pydantic_fields__['a'].description == 'A docs'
Expand Down

0 comments on commit cd9ad99

Please sign in to comment.