From f12f5bc0757e5a3f3029fee8c23b2339ac0cc738 Mon Sep 17 00:00:00 2001 From: Pawel Budzynski Date: Thu, 29 Apr 2021 14:48:56 +0200 Subject: [PATCH] add tests --- tests/roots/test-autosummary/dummy_module.py | 7 +++++++ tests/test_ext_autosummary.py | 2 ++ 2 files changed, 9 insertions(+) diff --git a/tests/roots/test-autosummary/dummy_module.py b/tests/roots/test-autosummary/dummy_module.py index 93d482b59..4adc0313e 100644 --- a/tests/roots/test-autosummary/dummy_module.py +++ b/tests/roots/test-autosummary/dummy_module.py @@ -3,6 +3,7 @@ module_attr C.class_attr + C.instance_attr C.prop_attr1 C.prop_attr2 C.C2 @@ -51,6 +52,12 @@ class C: #: 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 diff --git a/tests/test_ext_autosummary.py b/tests/test_ext_autosummary.py index 5d92b6afd..71868d492 100644 --- a/tests/test_ext_autosummary.py +++ b/tests/test_ext_autosummary.py @@ -161,6 +161,7 @@ def test_get_items_summary(make_app, app_params): 'emptyLine': "This is the real summary", 'module_attr': 'This is a module attribute', 'C.class_attr': 'This is a class attribute', + 'C.instance_attr': 'This is an instance attribute', 'C.prop_attr1': 'This is a function docstring', 'C.prop_attr2': 'This is a attribute docstring', 'C.C2': 'This is a nested inner class docstring', @@ -329,6 +330,7 @@ def test_autosummary_generate(app, status, warning): ' ~Foo.CONSTANT3\n' ' ~Foo.CONSTANT4\n' ' ~Foo.baz\n' + ' ~Foo.value\n' ' \n' in Foo) FooBar = (app.srcdir / 'generated' / 'autosummary_dummy_module.Foo.Bar.rst').read_text()