From ceb2b991779e58cf967672942e5424afca3f1af8 Mon Sep 17 00:00:00 2001 From: satr Date: Tue, 29 Oct 2024 12:05:52 +0530 Subject: [PATCH] add in members too --- ...ummary_dummy_complex_inheritance_module.py | 17 +++++- tests/test_extensions/test_ext_autosummary.py | 57 +------------------ 2 files changed, 17 insertions(+), 57 deletions(-) diff --git a/tests/roots/test-ext-autosummary/autosummary_dummy_complex_inheritance_module.py b/tests/roots/test-ext-autosummary/autosummary_dummy_complex_inheritance_module.py index 0b94d059268..ca3110617ca 100644 --- a/tests/roots/test-ext-autosummary/autosummary_dummy_complex_inheritance_module.py +++ b/tests/roots/test-ext-autosummary/autosummary_dummy_complex_inheritance_module.py @@ -79,12 +79,23 @@ def __init__(self): __all__ = ["Parent", "Child", "Baby", "Job", "Architect", "Jerry"] +members_3_11 = ['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', + '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', + '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', + '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', + '__sizeof__', '__str__', '__subclasshook__', '__weakref__'] +members_3_13 = ['__firstlineno__', '__static_attributes__'] + if sys.version_info[:2] >= (3, 14): - built_in_attr = ['__annotate__', '__annotations__', '__dict__', '__doc__', '__firstlineno__', + built_in_attr = ['__annotate__', '__annotations__', '__dict__', '__doc__', '__firstlineno__', '__module__', '__static_attributes__', '__weakref__'] + built_in_members = (members_3_11 + members_3_13).sort() elif sys.version_info[:2] >= (3, 13): - built_in_attr = ['__annotations__', '__dict__', '__doc__', '__firstlineno__', '__module__', + built_in_attr = ['__annotations__', '__dict__', '__doc__', '__firstlineno__', '__module__', '__static_attributes__', '__weakref__'] + built_in_members = (members_3_11 + members_3_13).sort() elif sys.version_info[:2] >= (3, 11): - built_in_attr = ['__annotations__', '__dict__', '__doc__', '__module__', '__weakref__'] \ No newline at end of file + built_in_attr = ['__annotations__', '__dict__', '__doc__', '__module__', '__weakref__'] + built_in_members = members_3_11 + diff --git a/tests/test_extensions/test_ext_autosummary.py b/tests/test_extensions/test_ext_autosummary.py index a819d6631e5..11db8a1afa5 100644 --- a/tests/test_extensions/test_ext_autosummary.py +++ b/tests/test_extensions/test_ext_autosummary.py @@ -574,6 +574,7 @@ def test_autosummary_generate_content_for_module_imported_members_complex_inheri import autosummary_dummy_complex_inheritance_module built_in_attr = autosummary_dummy_complex_inheritance_module.built_in_attr + built_in_members = autosummary_dummy_complex_inheritance_module.built_in_members template_jerry = Mock() @@ -713,33 +714,7 @@ def test_autosummary_generate_content_for_module_imported_members_complex_inheri ] assert context['members'] == [ - '__class__', - '__delattr__', - '__dict__', - '__dir__', - '__doc__', - '__eq__', - '__format__', - '__ge__', - '__getattribute__', - '__getstate__', - '__gt__', - '__hash__', - '__init__', - '__init_subclass__', - '__le__', - '__lt__', - '__module__', - '__ne__', - '__new__', - '__reduce__', - '__reduce_ex__', - '__repr__', - '__setattr__', - '__sizeof__', - '__str__', - '__subclasshook__', - '__weakref__', + *built_in_members, 'addition', 'get_age', 'get_name', @@ -875,33 +850,7 @@ def test_autosummary_generate_content_for_module_imported_members_complex_inheri 'BabyInnerClass', '__private_baby_name', '__annotations__', - '__class__', - '__delattr__', - '__dict__', - '__dir__', - '__doc__', - '__eq__', - '__format__', - '__ge__', - '__getattribute__', - '__getstate__', - '__gt__', - '__hash__', - '__init__', - '__init_subclass__', - '__le__', - '__lt__', - '__module__', - '__ne__', - '__new__', - '__reduce__', - '__reduce_ex__', - '__repr__', - '__setattr__', - '__sizeof__', - '__str__', - '__subclasshook__', - '__weakref__', + *built_in_members, 'addition', 'get_age', 'get_name',