mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-11-02 20:30:30 -06:00
Merge branch '2.4.x' into 7183_attr_ref_over_intersphinx
This commit is contained in:
5 files changed
+55
-5
No files matched your search
@@ -3,6 +3,16 @@ class AsyncClass:
|
||||
"""A documented coroutine function"""
|
||||
attr_coro_result = await _other_coro_func() # NOQA
|
||||
|
||||
@classmethod
|
||||
async def do_coroutine2(cls):
|
||||
"""A documented coroutine classmethod"""
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
async def do_coroutine3():
|
||||
"""A documented coroutine staticmethod"""
|
||||
pass
|
||||
|
||||
|
||||
async def _other_coro_func():
|
||||
return "run"
|
||||
+17
-1
@@ -1319,7 +1319,23 @@ def test_coroutine():
|
||||
' :async:',
|
||||
' ',
|
||||
' A documented coroutine function',
|
||||
' '
|
||||
' ',
|
||||
' ',
|
||||
' .. py:method:: AsyncClass.do_coroutine2()',
|
||||
' :module: target.coroutine',
|
||||
' :async:',
|
||||
' :classmethod:',
|
||||
' ',
|
||||
' A documented coroutine classmethod',
|
||||
' ',
|
||||
' ',
|
||||
' .. py:method:: AsyncClass.do_coroutine3()',
|
||||
' :module: target.coroutine',
|
||||
' :async:',
|
||||
' :staticmethod:',
|
||||
' ',
|
||||
' A documented coroutine staticmethod',
|
||||
' ',
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -419,6 +419,16 @@ def test_dict_customtype():
|
||||
assert "<CustomType(2)>: 2" in description
|
||||
|
||||
|
||||
@pytest.mark.sphinx(testroot='ext-autodoc')
|
||||
def test_isclassmethod(app):
|
||||
from target.methods import Base, Inherited
|
||||
|
||||
assert inspect.isclassmethod(Base.classmeth) is True
|
||||
assert inspect.isclassmethod(Base.meth) is False
|
||||
assert inspect.isclassmethod(Inherited.classmeth) is True
|
||||
assert inspect.isclassmethod(Inherited.meth) is False
|
||||
|
||||
|
||||
@pytest.mark.sphinx(testroot='ext-autodoc')
|
||||
def test_isstaticmethod(app):
|
||||
from target.methods import Base, Inherited
|
||||
|
||||
Reference in new issue
Block a user