mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #9479: autodoc: Emit a warning if target is a mocked object
This commit is contained in:
parent
f59026865a
commit
a7daa19a93
1
CHANGES
1
CHANGES
@ -14,6 +14,7 @@ Features added
|
||||
--------------
|
||||
|
||||
* #9445: autodoc: Support class properties
|
||||
* #9479: autodoc: Emit a warning if target is a mocked object
|
||||
* #9445: py domain: ``:py:property:`` directive supports ``:classmethod:``
|
||||
option to describe the class property
|
||||
|
||||
|
@ -913,6 +913,10 @@ class Documenter:
|
||||
if not self.import_object():
|
||||
return
|
||||
|
||||
if ismock(self.object):
|
||||
logger.warning(__('A mocked object is detected: %r'),
|
||||
self.name, type='autodoc')
|
||||
|
||||
# If there is no real module defined, figure out which to use.
|
||||
# The real module is used in the module analyzer to look up the module
|
||||
# where the attribute documentation would actually be found in.
|
||||
|
Loading…
Reference in New Issue
Block a user