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

Function test_math_compat

tests/test_extensions/test_ext_math.py:327–362  ·  view source on GitHub ↗
(app: SphinxTestApp)

Source from the content-addressed store, hash-verified

325
326@pytest.mark.sphinx('dummy', testroot='ext-math-compat')
327def test_math_compat(app: SphinxTestApp) -> None:
328 with warnings.catch_warnings(record=True):
329 app.build(force_all=True)
330 doctree = app.env.get_and_resolve_doctree('index', app.builder, tags=app.tags)
331 assert_node(
332 doctree,
333 [
334 nodes.document,
335 nodes.section,
336 (
337 nodes.title,
338 [nodes.section, (nodes.title, nodes.paragraph)],
339 nodes.section,
340 ),
341 ],
342 )
343 assert_node(
344 extract_node(doctree, 0, 1, 1),
345 (
346 'Inline: ',
347 [nodes.math, 'E=mc^2'],
348 '\nInline my math: ',
349 [nodes.math, 'E = mc^2'],
350 ),
351 )
352 assert_node(
353 extract_node(doctree, 0, 2),
354 (
355 [nodes.title, 'block'],
356 [nodes.math_block, 'a^2+b^2=c^2\n\n'],
357 [nodes.paragraph, 'Second math'],
358 [nodes.math_block, 'e^{i\\pi}+1=0\n\n'],
359 [nodes.paragraph, 'Multi math equations'],
360 [nodes.math_block, 'E = mc^2'],
361 ),
362 )
363
364
365@pytest.mark.sphinx(

Callers

nothing calls this directly

Calls 4

assert_nodeFunction · 0.90
extract_nodeFunction · 0.90
buildMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…