Skip to content

Commit 4162038

Browse files
committed
tests: test nested alias produces correct signature
1 parent f507dea commit 4162038

File tree

5 files changed

+29
-3
lines changed

5 files changed

+29
-3
lines changed

quartodoc/tests/__snapshots__/test_renderers.ambr

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,15 @@
268268
A function
269269
'''
270270
# ---
271+
# name: test_render_doc_signature_name_alias_of_alias
272+
'''
273+
# example.a_nested_alias { #quartodoc.tests.example.a_nested_alias }
274+
275+
`tests.example.a_nested_alias()`
276+
277+
A nested alias target
278+
'''
279+
# ---
271280
# name: test_render_docstring_numpy_linebreaks
272281
'''
273282
# f_numpy_with_linebreaks { #quartodoc.tests.example_docstring_styles.f_numpy_with_linebreaks }

quartodoc/tests/example.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
# flake8: noqa
44

5-
from quartodoc.tests.example_alias_target import alias_target as a_alias
5+
from quartodoc.tests.example_alias_target import (
6+
alias_target as a_alias,
7+
nested_alias_target as a_nested_alias,
8+
)
69

710

811
def a_func():
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
1+
from quartodoc.tests.example_alias_target__nested import ( # noqa: F401
2+
nested_alias_target,
3+
)
4+
5+
16
def alias_target():
27
"""An alias target"""

quartodoc/tests/test_builder_blueprint.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ def test_blueprint_auto_package(bp):
133133
assert sections[0].title == "quartodoc.tests.example"
134134
assert sections[0].desc == "A module"
135135

136-
# 4 objects documented
137-
assert len(sections[0].contents) == 4
136+
# 5 objects documented
137+
assert len(sections[0].contents) == 5
138138

139139

140140
def test_blueprint_layout_options():

quartodoc/tests/test_renderers.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,12 @@ def test_render_doc_signature_name(snapshot, renderer):
164164
res = renderer.render(bp)
165165

166166
assert res == snapshot
167+
168+
169+
def test_render_doc_signature_name_alias_of_alias(snapshot, renderer):
170+
auto = Auto(name="example.a_nested_alias", package="quartodoc.tests")
171+
bp = blueprint(auto)
172+
173+
res = renderer.render(bp)
174+
175+
assert res == snapshot

0 commit comments

Comments
 (0)