mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add a test for doc on coroutine functions and general support for async/await py3.5 syntax
This commit is contained in:
@@ -636,6 +636,10 @@ def test_generate():
|
||||
('attribute', 'test_autodoc.Class.inst_attr_string'),
|
||||
('method', 'test_autodoc.Class.moore'),
|
||||
])
|
||||
if six.PY3 and sys.version_info[:2] >= (3, 5):
|
||||
should.extend([
|
||||
('method', 'test_autodoc.Class.do_coroutine'),
|
||||
])
|
||||
options.members = ALL
|
||||
assert_processes(should, 'class', 'Class')
|
||||
options.undoc_members = True
|
||||
@@ -791,6 +795,7 @@ def test_generate():
|
||||
'module', 'test_autodoc')
|
||||
|
||||
# --- generate fodder ------------
|
||||
import six, sys
|
||||
|
||||
__all__ = ['Class']
|
||||
|
||||
@@ -833,6 +838,12 @@ class Base(object):
|
||||
def inheritedmeth(self):
|
||||
"""Inherited function."""
|
||||
|
||||
if six.PY3 and sys.version_info[:2] >= (3, 5):
|
||||
|
||||
async def _other_coro_func():
|
||||
return "run"
|
||||
|
||||
|
||||
class Class(Base):
|
||||
"""Class to document."""
|
||||
|
||||
@@ -889,6 +900,13 @@ class Class(Base):
|
||||
# undocumented special method
|
||||
pass
|
||||
|
||||
if six.PY3 and sys.version_info[:2] >= (3, 5):
|
||||
|
||||
async def do_coroutine(self):
|
||||
"""A documented coroutine function"""
|
||||
|
||||
attr_coro_result = await _other_coro_func()
|
||||
|
||||
|
||||
class CustomDict(dict):
|
||||
"""Docstring."""
|
||||
|
||||
Reference in New Issue
Block a user