summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoris Van den Bossche <jorisvandenbossche@gmail.com>2018-03-30 09:52:58 +0200
committerJoris Van den Bossche <jorisvandenbossche@gmail.com>2018-03-30 09:52:58 +0200
commitb311805f5074084e2783c9e6c0dd8f4e57fb87fd (patch)
tree4e47d22e74c312d932239cb3c0e5bea9137d8aaf
parent5c2f4fee21108bbca3c44ceae340e2f8bdd64ec5 (diff)
downloadnumpydoc-b311805f5074084e2783c9e6c0dd8f4e57fb87fd.tar.gz
add test
-rw-r--r--numpydoc/tests/test_docscrape.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/numpydoc/tests/test_docscrape.py b/numpydoc/tests/test_docscrape.py
index 2fb4eb5..7c9ca99 100644
--- a/numpydoc/tests/test_docscrape.py
+++ b/numpydoc/tests/test_docscrape.py
@@ -1179,6 +1179,32 @@ def test_class_members_doc_sphinx():
""")
+def test_class_members_as_member_list():
+
+ class Foo:
+ @property
+ def an_attribute(self):
+ """Test attribute"""
+ return None
+
+ attr_doc = """:Attributes:
+
+ :obj:`an_attribute <an_attribute>`
+ Test attribute"""
+
+ assert attr_doc in str(SphinxClassDoc(Foo))
+
+ attr_doc2 = """.. rubric:: Attributes
+
+.. autosummary::
+ :toctree:
+
+ an_attribute"""
+
+ cfg = dict(attributes_as_param_list=False)
+ assert attr_doc2 in str(SphinxClassDoc(Foo, config=cfg))
+
+
def test_templated_sections():
doc = SphinxClassDoc(None, class_doc_txt,
config={'template': jinja2.Template('{{examples}}\n{{parameters}}')})