summaryrefslogtreecommitdiff
path: root/tests/test_autodoc.py
diff options
context:
space:
mode:
authorshimizukawa <shimizukawa@gmail.com>2013-01-12 18:12:55 +0900
committershimizukawa <shimizukawa@gmail.com>2013-01-12 18:12:55 +0900
commite17cfb522d2a62321dde3e781098e524d8cf91e2 (patch)
treede8c8fd9a73df6b35fb29cf38942434d92de2679 /tests/test_autodoc.py
parent3f309459018bea48cc731d4ca9d5fb9d8fc8e6a0 (diff)
downloadsphinx-e17cfb522d2a62321dde3e781098e524d8cf91e2.tar.gz
fix: autodoc documented descriptor class as attribute
Diffstat (limited to 'tests/test_autodoc.py')
-rw-r--r--tests/test_autodoc.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_autodoc.py b/tests/test_autodoc.py
index 7a1d6d7f..be6c4ec9 100644
--- a/tests/test_autodoc.py
+++ b/tests/test_autodoc.py
@@ -581,6 +581,13 @@ def test_generate():
del directive.env.temp_data['autodoc:module']
del directive.env.temp_data['py:module']
+ # test descriptor class documentation
+ options.members = ['CustomDataDescriptor']
+ assert_result_contains('.. py:class:: CustomDataDescriptor(doc)',
+ 'module', 'test_autodoc')
+ assert_result_contains(' .. py:method:: CustomDataDescriptor.meth()',
+ 'module', 'test_autodoc')
+
# --- generate fodder ------------
__all__ = ['Class']
@@ -605,6 +612,10 @@ class CustomDataDescriptor(object):
return self
return 42
+ def meth(self):
+ """Function."""
+ return "The Answer"
+
def _funky_classmethod(name, b, c, d, docstring=None):
"""Generates a classmethod for a class from a template by filling out
some arguments."""