mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Close #8034: autodoc: :private-member: can take an list of member names
Now :private-member: option can take an explicit list of member names to be documented as its arguments (like :special-members: does).
This commit is contained in:
@@ -60,3 +60,24 @@ def test_private_field_and_private_members(app):
|
||||
' :meta private:',
|
||||
'',
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.sphinx('html', testroot='ext-autodoc')
|
||||
def test_private_members(app):
|
||||
app.config.autoclass_content = 'class'
|
||||
options = {"members": None,
|
||||
"private-members": "_public_function"}
|
||||
actual = do_autodoc(app, 'module', 'target.private', options)
|
||||
assert list(actual) == [
|
||||
'',
|
||||
'.. py:module:: target.private',
|
||||
'',
|
||||
'',
|
||||
'.. py:function:: _public_function(name)',
|
||||
' :module: target.private',
|
||||
'',
|
||||
' public_function is a docstring().',
|
||||
'',
|
||||
' :meta public:',
|
||||
'',
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user