diff options
author | Pauli Virtanen <pav@iki.fi> | 2013-02-16 16:42:46 +0200 |
---|---|---|
committer | Pauli Virtanen <pav@iki.fi> | 2013-02-16 17:48:32 +0200 |
commit | a3bc1467dee14dd4726a83af2fb1a4cb89cbf53b (patch) | |
tree | 81280721c42661e6214adbfba2af8e725db434bd | |
parent | 1b2e585133c555d1b5f72c5598473a7568587645 (diff) | |
download | numpy-a3bc1467dee14dd4726a83af2fb1a4cb89cbf53b.tar.gz |
BUG: numpydoc: check that it works with sub-classes
-rw-r--r-- | doc/sphinxext/numpydoc/docscrape.py | 2 | ||||
-rw-r--r-- | doc/sphinxext/numpydoc/tests/test_docscrape.py | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/doc/sphinxext/numpydoc/docscrape.py b/doc/sphinxext/numpydoc/docscrape.py index e4bf308b5..8f26797fe 100644 --- a/doc/sphinxext/numpydoc/docscrape.py +++ b/doc/sphinxext/numpydoc/docscrape.py @@ -511,7 +511,7 @@ class ClassDoc(NumpyDocString): return [name for name,func in inspect.getmembers(self._cls) if ((not name.startswith('_') or name in self.extra_public_methods) - and callable(func))] + and callable(func) and not isinstance(func, type))] @property def properties(self): diff --git a/doc/sphinxext/numpydoc/tests/test_docscrape.py b/doc/sphinxext/numpydoc/tests/test_docscrape.py index aed57fb26..27b0fb60a 100644 --- a/doc/sphinxext/numpydoc/tests/test_docscrape.py +++ b/doc/sphinxext/numpydoc/tests/test_docscrape.py @@ -603,6 +603,10 @@ def test_class_members(): """Spammity index""" return 0.95 + class Ignorable(object): + """local class, to be ignored""" + pass + for cls in (ClassDoc, SphinxClassDoc): doc = cls(Dummy, config=dict(show_class_members=False)) assert 'Methods' not in str(doc), (cls, str(doc)) |