diff options
author | Anselm Kruis <a.kruis@science-computing.de> | 2016-02-05 17:15:27 +0100 |
---|---|---|
committer | Anselm Kruis <a.kruis@science-computing.de> | 2016-02-05 17:42:14 +0100 |
commit | de356149cda6076555fbff768590aa1ab483fec1 (patch) | |
tree | 59d960409ab5edf96e304066eb51afc8c4e04d9b /tests/test_ext_viewcode.py | |
parent | 50951bdc9814109df848e12dd08b6a6bbdb01889 (diff) | |
download | sphinx-git-de356149cda6076555fbff768590aa1ab483fec1.tar.gz |
Test for bug #2298: automodule fails to document a class attribute
This test case demonstrates a bug, where automodule:: with option
:members: fails to document a class attribute of a class, that was
imported into the documented module.
This commit extends test_ext_viewcode, instead of creating a separate
test module, because the development guide recommends it for performance
reasons.
Diffstat (limited to 'tests/test_ext_viewcode.py')
-rw-r--r-- | tests/test_ext_viewcode.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_ext_viewcode.py b/tests/test_ext_viewcode.py index 93e681a5d..eaa7a736d 100644 --- a/tests/test_ext_viewcode.py +++ b/tests/test_ext_viewcode.py @@ -31,6 +31,12 @@ def test_viewcode(app, status, warning): assert result.count('href="_modules/spam/mod1.html#Class1"') == 2 assert result.count('href="_modules/spam/mod2.html#Class2"') == 2 + # test that the class attribute is correctly documented + assert result.count('this is Class3') == 2 + assert 'this is the class attribute class_attr' in result + # the next assert fails, until the autodoc bug gets fixed + assert result.count('this is the class attribute class_attr') == 2 + @with_app(testroot='ext-viewcode', tags=['test_linkcode']) def test_linkcode(app, status, warning): |