diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-06-02 16:20:49 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-02 16:20:49 +0900 |
commit | 27dd8367c65c4313d499d945e7a2804865a1754a (patch) | |
tree | 3b6927848c04e9c43011f6af538353e088462f26 /tests/test_autodoc.py | |
parent | 91fceb4b5f673aca6b9810cd4ff62a482f162ecf (diff) | |
parent | 69d93c967c591a65f10bcb9cb07e03d5cf03cce6 (diff) | |
download | sphinx-git-27dd8367c65c4313d499d945e7a2804865a1754a.tar.gz |
Merge pull request #6423 from tk0miya/1063_autodoc_undoc_module_variables
Fix #1063: autodoc: automodule directive handles undocumented module level variables
Diffstat (limited to 'tests/test_autodoc.py')
-rw-r--r-- | tests/test_autodoc.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test_autodoc.py b/tests/test_autodoc.py index f6f5a618c..518d23e8c 100644 --- a/tests/test_autodoc.py +++ b/tests/test_autodoc.py @@ -1689,6 +1689,30 @@ def test_partialmethod(app): assert list(actual) == expected +@pytest.mark.usefixtures('setup_test') +def test_module_variables(): + options = {"members": None, + "undoc-members": True} + actual = do_autodoc(app, 'module', 'target.module', options) + assert list(actual) == [ + '', + '.. py:module:: target.module', + '', + '', + '.. py:data:: CONSTANT1', + ' :module: target.module', + " :annotation: = ''", + '', + ' docstring for CONSTANT1', + ' ', + '', + '.. py:data:: CONSTANT2', + ' :module: target.module', + " :annotation: = ''", + '', + ] + + @pytest.mark.sphinx('html', testroot='ext-autodoc') def test_autodoc_typehints_signature(app): app.config.autodoc_typehints = "signature" |