From cf7da1843c45a4c2df7a749f7886a2d2ba0ee92a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 19:25:40 +0200 Subject: Adding upstream version 7.2.6. Signed-off-by: Daniel Baumann --- tests/roots/test-ext-autosummary-skip-member/conf.py | 20 ++++++++++++++++++++ .../roots/test-ext-autosummary-skip-member/index.rst | 4 ++++ .../roots/test-ext-autosummary-skip-member/target.py | 14 ++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 tests/roots/test-ext-autosummary-skip-member/conf.py create mode 100644 tests/roots/test-ext-autosummary-skip-member/index.rst create mode 100644 tests/roots/test-ext-autosummary-skip-member/target.py (limited to 'tests/roots/test-ext-autosummary-skip-member') diff --git a/tests/roots/test-ext-autosummary-skip-member/conf.py b/tests/roots/test-ext-autosummary-skip-member/conf.py new file mode 100644 index 0000000..7c8f0e9 --- /dev/null +++ b/tests/roots/test-ext-autosummary-skip-member/conf.py @@ -0,0 +1,20 @@ +import os +import sys + +sys.path.insert(0, os.path.abspath('.')) + + +extensions = ['sphinx.ext.autosummary'] +autosummary_generate = True +autodoc_default_options = {'members': True} + + +def skip_member(app, what, name, obj, skip, options): + if name == 'skipmeth': + return True + elif name == '_privatemeth': + return False + + +def setup(app): + app.connect('autodoc-skip-member', skip_member) diff --git a/tests/roots/test-ext-autosummary-skip-member/index.rst b/tests/roots/test-ext-autosummary-skip-member/index.rst new file mode 100644 index 0000000..c376a13 --- /dev/null +++ b/tests/roots/test-ext-autosummary-skip-member/index.rst @@ -0,0 +1,4 @@ +.. autosummary:: + :toctree: generate + + target.Foo diff --git a/tests/roots/test-ext-autosummary-skip-member/target.py b/tests/roots/test-ext-autosummary-skip-member/target.py new file mode 100644 index 0000000..fdf557e --- /dev/null +++ b/tests/roots/test-ext-autosummary-skip-member/target.py @@ -0,0 +1,14 @@ +class Foo: + """docstring of Foo.""" + + def meth(self): + """docstring of meth.""" + pass + + def skipmeth(self): + """docstring of skipmeth.""" + pass + + def _privatemeth(self): + """docstring of _privatemeth.""" + pass -- cgit v1.2.3