Skip to content

Commit 645dea6

Browse files
committed
tests: test dynamically loaded method loads parent dynamically
1 parent 0851788 commit 645dea6

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

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)