Commit Graph

14 Commits

Author SHA1 Message Date
Takeshi KOMIYA
b84771dcd2 A happy new year! 2022-01-01 18:45:03 +09:00
Takeshi KOMIYA
f88ac53e51 Fix #9883: autodoc: doccomment for the alias to mocked object was ignored 2021-11-29 02:06:16 +09:00
Takeshi KOMIYA
a78c6b799f Fix #8134: autodoc: crashes when mocked decorator takes arguments
autodoc crashed when a decorator in mocked module takes arguments
because mock system returns the first argument for the decorator as a
decorated object.

This changes the approach for mocking decorators that remembers
arguments for each decoration, and fetch the latest argument on
generating document.
2021-01-24 14:18:00 +09:00
Takeshi KOMIYA
f996859420 A happy new year!
.. note::

   $ find sphinx tests LICENSE doc/conf.py -type f -exec sed -i '' -e 's/2007\-20../2007-2021/' {} \;
   $ git co sphinx/locale/**/*.js sphinx/templates/epub3/mimetype
2021-01-01 13:40:48 +09:00
Takeshi KOMIYA
476169284d autodoc: Add a helper that checks the object is mocked; ismock() 2020-12-28 21:50:36 +09:00
Takeshi KOMIYA
d6ca2f97be Fix #7886: autodoc: TypeError is raised on mocking generic-typed classes 2020-06-30 01:16:38 +09:00
Takeshi KOMIYA
0319faf8f1 Merge branch '2.0' 2020-01-01 14:40:39 +09:00
Takeshi KOMIYA
eaf495c3c4 A happy new year! 2020-01-01 14:27:43 +09:00
Takeshi KOMIYA
a6a2a59ab0 Merge branch '2.0' 2019-10-20 13:43:30 +09:00
Takeshi KOMIYA
59336da8bd Fix #6709: autodoc: mock object does not work as a class decorator 2019-10-06 23:31:07 +09:00
Takeshi KOMIYA
01f8dad160 Merge branch '2.0' 2019-08-19 00:37:30 +09:00
Jon Dufresne
ecb1e763ad Switch uses of __import__ to importlib.get_module()
The Python docs for __import__ recommend using importlib.get_module().

https://docs.python.org/3/library/functions.html#__import__

> Note: This is an advanced function that is not needed in everyday
> Python programming, unlike importlib.import_module().

As importlib.get_module() uses the Python module cache and returns the
module, this also allows simplifying many module cache checks of use of
sys.modules.

importlib.get_module() has been available since Python 3.3.
2019-08-17 11:45:39 -07:00
Takeshi KOMIYA
61098a0ae2 Drop features and APIs deprecated in 1.8 2019-03-30 14:50:37 +09:00
Takeshi KOMIYA
af51e9825a refactor: Move implementation of mock to sphinx.ext.autodoc.mock 2019-02-27 21:42:23 +09:00