Skip to content

Suppress mock object warnings from autodoc #9655

@sdhiscocks

Description

@sdhiscocks

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).

WARNING: A mocked object is detected: 'example.mock.object'

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions