(app: SphinxTestApp)
| 325 | |
| 326 | @pytest.mark.sphinx('dummy', testroot='ext-math-compat') |
| 327 | def 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( |
nothing calls this directly
no test coverage detected
searching dependent graphs…