diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 17:25:40 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 17:25:40 +0000 |
commit | cf7da1843c45a4c2df7a749f7886a2d2ba0ee92a (patch) | |
tree | 18dcde1a8d1f5570a77cd0c361de3b490d02c789 /tests/roots/test-autosummary/dummy_module.py | |
parent | Initial commit. (diff) | |
download | sphinx-upstream/7.2.6.tar.xz sphinx-upstream/7.2.6.zip |
Adding upstream version 7.2.6.upstream/7.2.6
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/roots/test-autosummary/dummy_module.py')
-rw-r--r-- | tests/roots/test-autosummary/dummy_module.py | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/tests/roots/test-autosummary/dummy_module.py b/tests/roots/test-autosummary/dummy_module.py new file mode 100644 index 0000000..4adc031 --- /dev/null +++ b/tests/roots/test-autosummary/dummy_module.py @@ -0,0 +1,85 @@ +""" +.. autosummary:: + + module_attr + C.class_attr + C.instance_attr + C.prop_attr1 + C.prop_attr2 + C.C2 +""" + + +def withSentence(): + '''I have a sentence which + spans multiple lines. Then I have + more stuff + ''' + pass + + +def noSentence(): + '''this doesn't start with a + capital. so it's not considered + a sentence + ''' + pass + + +def emptyLine(): + '''This is the real summary + + However, it did't end with a period. + ''' + pass + + +#: This is a module attribute +#: +#: value is integer. +module_attr = 1 + + +class C: + ''' + My C class + + with class_attr attribute + ''' + + #: This is a class attribute + #: + #: value is integer. + class_attr = 42 + + def __init__(self): + #: This is an instance attribute + #: + #: value is a string + self.instance_attr = "42" + + def _prop_attr_get(self): + """ + This is a function docstring + + return value is string. + """ + return 'spam egg' + + prop_attr1 = property(_prop_attr_get) + + prop_attr2 = property(_prop_attr_get) + """ + This is a attribute docstring + + value is string. + """ + + class C2: + ''' + This is a nested inner class docstring + ''' + + +def func(arg_, *args, **kwargs): + """Test function take an argument ended with underscore.""" |