summaryrefslogtreecommitdiff
path: root/tests/test_ext_autodoc_autoattribute.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_ext_autodoc_autoattribute.py')
-rw-r--r--tests/test_ext_autodoc_autoattribute.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/test_ext_autodoc_autoattribute.py b/tests/test_ext_autodoc_autoattribute.py
index f3fffe75b..48e897b2e 100644
--- a/tests/test_ext_autodoc_autoattribute.py
+++ b/tests/test_ext_autodoc_autoattribute.py
@@ -189,3 +189,29 @@ def test_autoattribute_TypeVar(app):
" alias of TypeVar('T1')",
'',
]
+
+
+@pytest.mark.skipif(sys.version_info < (3, 6), reason='python 3.6+ is required.')
+@pytest.mark.sphinx('html', testroot='ext-autodoc')
+def test_autoattribute_hide_value(app):
+ actual = do_autodoc(app, 'attribute', 'target.hide_value.Foo.SENTINEL1')
+ assert list(actual) == [
+ '',
+ '.. py:attribute:: Foo.SENTINEL1',
+ ' :module: target.hide_value',
+ '',
+ ' docstring',
+ '',
+ ' :meta hide-value:',
+ '',
+ ]
+
+ actual = do_autodoc(app, 'attribute', 'target.hide_value.Foo.SENTINEL2')
+ assert list(actual) == [
+ '',
+ '.. py:attribute:: Foo.SENTINEL2',
+ ' :module: target.hide_value',
+ '',
+ ' :meta hide-value:',
+ '',
+ ]