I use Sphinx for autodocs, but I find it annoying how it by default appends the parent class docstring to my docstring.
The result is that for each and every documented test class inheriting from unittest.TestCase, I get the docstring "Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name." appended. So these two sentences litter my test documentation, over and over again.
How can I stop Sphinx from pulling the docstring from the parent?
There's a setting:
autodoc_inherit_docstrings
This value controls the docstrings inheritance. If set to
Truethe docstring for classes or methods, if not explicitly set, is inherited form (sic) parents.The default is
True.New in version 1.7.
Although use with care - this setting appears to break a directive I'm calling in docstrings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With