MCPcopy
hub / github.com/sphinx-doc/sphinx / test_default_role2

Function test_default_role2

tests/test_markup/test_markup.py:773–789  ·  view source on GitHub ↗
(app: SphinxTestApp)

Source from the content-addressed store, hash-verified

771 confoverrides={'default_role': 'guilabel'},
772)
773def test_default_role2(app: SphinxTestApp) -> None:
774 app.build(force_all=True)
775
776 # default-role directive is stronger than configratuion
777 doctree = app.env.get_doctree('index')
778 assert isinstance(doctree[0], nodes.section)
779 assert_node(extract_node(doctree, 0, 1), nodes.paragraph)
780 assert_node(extract_node(doctree, 0, 1, 0), addnodes.index)
781 assert_node(extract_node(doctree, 0, 1, 1), nodes.target)
782 assert_node(extract_node(doctree, 0, 1, 2), nodes.reference, classes=['pep'])
783
784 # default_role changes the default behavior
785 doctree = app.env.get_doctree('foo')
786 assert isinstance(doctree[0], nodes.section)
787 assert_node(extract_node(doctree, 0, 1), nodes.paragraph)
788 assert_node(extract_node(doctree, 0, 1, 0), nodes.inline, classes=['guilabel'])
789 assert_node(extract_node(doctree, 0, 1, 1), nodes.Text)

Callers

nothing calls this directly

Calls 4

assert_nodeFunction · 0.90
extract_nodeFunction · 0.90
get_doctreeMethod · 0.80
buildMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…