Skip to content

Commit 71c8352

Browse files
authored
Merge pull request #39 from python-desert/napoleon
Convert to napoleon style docstrings
2 parents 1826ee0 + 5cb55ca commit 71c8352

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

src/desert/_make.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,19 @@ def class_schema(
8181
clazz: type, meta: t.Dict[str, t.Any] = {}
8282
) -> t.Type[marshmallow.Schema]:
8383
"""
84-
Convert a class to a marshmallow schema
85-
:param clazz: A python class (may be a dataclass)
86-
:return: A marshmallow Schema corresponding to the dataclass
84+
Convert a class to a marshmallow schema.
85+
86+
Args:
87+
clazz: A python class (may be a dataclass)
88+
meta: The marshmallow schema metadata dict.
89+
90+
Returns:
91+
A :class:`marshmallow.Schema` type corresponding to the dataclass.
92+
8793
.. note::
8894
All the arguments supported by marshmallow field classes are can
8995
be passed in the `metadata` dictionary of a field.
96+
9097
If you want to use a custom marshmallow field
9198
(one that has no equivalent python type), you can pass it as the
9299
``marshmallow_field`` key in the metadata dictionary.

tests/test_make.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,13 @@ def fixture_from_dict(
8787
"""
8888
Create fixture parametrized to yield each value and labeled with the
8989
corresponding ID.
90-
:param name: Name of the fixture itself
91-
:param id_to_value: Mapping from ID labels to values
92-
:return: The PyTest fixture
90+
91+
Args:
92+
name: Name of the fixture itself
93+
id_to_value: Mapping from ID labels to values
94+
95+
Returns:
96+
The PyTest fixture
9397
"""
9498
@pytest.fixture(
9599
name=name,

0 commit comments

Comments
 (0)