Skip to content

Commit 23c30e4

Browse files
committed
added test for inherited class attributes
as a check for #9
1 parent 40cbe97 commit 23c30e4

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

tests/sphinx_supp/dummy.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ def test_method_args_kwargs(self, *args, **kwargs):
6161
small_data = 'Should be skipped'
6262

6363

64+
class InheritedTestClass(TestClass):
65+
"""Class test for inherited attributes"""
66+
67+
6468
#: data to be skipped
6569
large_data = 'Should also be skipped'
6670

tests/sphinx_supp/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ Example documentation
55

66
test_module
77
test_class
8+
test_inherited
89
test_module_title
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Dummy Inherited Class Doc
2+
=========================
3+
4+
.. autoclass:: dummy.InheritedTestClass
5+
:inherited-members:

tests/test_autodocsumm.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,13 @@ def test_class(self, app, status, warning):
105105
'Attributes', 'Methods'),
106106
msg='class_caller Attribute not in the right Section!')
107107

108+
@with_app(buildername='html', srcdir=sphinx_supp,
109+
copy_srcdir_to_tmpdir=True)
110+
def test_inherited(self, app, status, warning):
111+
app.build()
112+
html = get_html(app, '/test_inherited.html')
113+
self.assertIn('<span class="pre">test_method</span>', html)
114+
108115

109116
if __name__ == '__main__':
110117
unittest.main()

0 commit comments

Comments
 (0)