File tree 1 file changed +32
-0
lines changed
1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,38 @@ without using a local copy. This can be convenient for small fixes.
89
89
The built documentation should be available in ``doc/en/_build/html ``,
90
90
where 'en' refers to the documentation language.
91
91
92
+ Pytest has an API reference which in large part is
93
+ `generated automatically <https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html >`_
94
+ from the docstrings of the documented items. Pytest uses the
95
+ `Sphinx docstring format <https://sphinx-rtd-tutorial.readthedocs.io/en/latest/docstrings.html >`_.
96
+ For example:
97
+
98
+ .. code-block :: python
99
+
100
+ def my_function (arg : ArgType) -> Foo:
101
+ """ Do important stuff.
102
+
103
+ More detailed info here, in separate paragraphs from the subject line.
104
+ Use proper sentences -- start sentences with capital letters and end
105
+ with periods.
106
+
107
+ Can include annotated documentation:
108
+
109
+ :param short_arg: An argument which determines stuff.
110
+ :param long_arg:
111
+ A long explanation which spans multiple lines, overflows
112
+ like this.
113
+ :returns: The result.
114
+ :raises ValueError:
115
+ Detailed information when this can happen.
116
+
117
+ .. versionadded:: 6.0
118
+
119
+ Including types into the annotations above is not necessary when
120
+ type-hinting is being used (as in this example).
121
+ """
122
+
123
+
92
124
.. _submitplugin :
93
125
94
126
Submitting Plugins to pytest-dev
You can’t perform that action at this time.
0 commit comments