Skip to content

Commit

Permalink
add in members too
Browse files Browse the repository at this point in the history
  • Loading branch information
satr-cowi committed Oct 29, 2024
1 parent 336d3e3 commit ceb2b99
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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__']
built_in_attr = ['__annotations__', '__dict__', '__doc__', '__module__', '__weakref__']
built_in_members = members_3_11

57 changes: 3 additions & 54 deletions tests/test_extensions/test_ext_autosummary.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit ceb2b99

Please sign in to comment.