tests.sphinx.test_sphinx_mermaid moduleΒΆ
Tests for the autoclasstree override that keeps d3 zoom off class diagrams.
- tests.sphinx.test_sphinx_mermaid.DIAGRAM = 'Class diagram of orchard.Pear.'ΒΆ
Text the stand-in
autoclasstreerenders for each diagram.
- class tests.sphinx.test_sphinx_mermaid.StubClassDiagram(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]ΒΆ
Bases:
DirectiveStand-in for the
autoclasstreedirective of sphinxcontrib-mermaid.- required_arguments = 1ΒΆ
Number of required directive arguments.
- tests.sphinx.test_sphinx_mermaid.stub_setup(app)[source]ΒΆ
Register what the override reads of sphinxcontrib-mermaid.
- tests.sphinx.test_sphinx_mermaid.mermaid_stub(monkeypatch)[source]ΒΆ
Serve a stand-in for sphinxcontrib-mermaid, which the test group lacks.
The stand-in only holds the directive and the config value the override reads.
- Return type:
- tests.sphinx.test_sphinx_mermaid.build(tmp_path, *, loaded, d3_zoom)[source]ΒΆ
Build a page, with an
autoclasstreediagram when the stand-in is loaded.click_extra.sphinxcomes first inextensions, before the directive it overrides is registered.d3_zoomsetsmermaid_d3_zoom, left to its default whenNone.
- tests.sphinx.test_sphinx_mermaid.test_class_diagrams_skip_the_zoom(tmp_path, loaded, d3_zoom, overridden)[source]ΒΆ
The override wraps each diagram only with sphinxcontrib-mermaid and zoom on.
The page then links the stylesheet the wrapper hooks into. Otherwise the directive renders as sphinxcontrib-mermaid draws it, or not at all.
- Return type: