Skip to content

Commit 4036ba3

Browse files
authored
Merge pull request #279 from machow/fix-dynamic-method
fix: dynamic child should load parent dynamically
2 parents 049a7ba + 8b37b14 commit 4036ba3

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

quartodoc/autosummary.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ def dynamic_alias(
346346
else:
347347
parent_path = mod_name.rsplit(".", 1)[0]
348348

349-
parent = get_object(parent_path, loader=loader)
349+
parent = get_object(parent_path, loader=loader, dynamic=True)
350350
return dc.Alias(attr_name, obj, parent=parent)
351351

352352

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from quartodoc.tests.example import * # noqa

quartodoc/tests/test_builder_blueprint.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,21 @@ def test_blueprint_fetch_members_include_inherited():
210210
assert "some_method" in member_names
211211

212212

213+
def test_blueprint_fetch_members_dynamic():
214+
# Since AClass is imported via star import it has to be dynamically
215+
# resolved. This test ensures that the members of AClass also get
216+
# loaded correctly.
217+
name = "quartodoc.tests.example_star_imports:AClass"
218+
auto = lo.Auto(name=name, members=["a_method"], dynamic=True)
219+
bp = blueprint(auto)
220+
221+
method_path = "quartodoc.tests.example_star_imports.AClass.a_method"
222+
223+
assert len(bp.members) == 1
224+
assert bp.members[0].obj.path == method_path
225+
assert bp.members[0].obj.parent.path == name.replace(":", ".")
226+
227+
213228
def test_blueprint_member_options():
214229
auto = lo.Auto(
215230
name="quartodoc.tests.example",

0 commit comments

Comments
 (0)