New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suppress mock object warnings from autodoc #9655
Comments
I think the warnings should not be emitted if the mocked object can produce valid docs. I think it's a bug of autodoc that emits incorrect warnings. So I don't think it's better to suppress them. Could you share an example to reproduce the warning? I'll try to fix it. |
So issue we've seen is with this Enum we have defined, where the enum name points to a (mocked) function. The Enum documentation looks fine despite the warning. We have a recent build on CircleCI which got caught on this warning, but no issues with documentation it produced. |
Thank you for example. I understand what happened. The enum subclass provides Note: Dockefile to reproduce the error:
|
…ned unexpectedly A warning for mocked object should not be emitted if it has doc comment.
…ned unexpectedly A warning for mocked object should not be emitted if it has doc comment.
…mment Fix #9655: autodoc: mocked object having doc comment is warned unexpectedly
Is your feature request related to a problem? Please describe.
When building with warnings as errors (
-W
flag), mock objects cause build failure (for example below).This occurs with class attributes, or enum members, pointing to mock objects, even if they are documented with
#:
, which produce valid documentation.Describe the solution you'd like
As suggested in #9631, it would be useful to have a
subtype
on the warning (e.g.mock_objects
) so these warnings can be ignored.Describe alternatives you've considered
Suppressing all autodoc warnings works, but this isn't ideal.
Additional context
The text was updated successfully, but these errors were encountered: