Commit 86f62b6
committed
Fix build failure with newer sphinx dependencies:
=================================== FAILURES ===================================
__________________________ test_sd_custom_directives ___________________________
sphinx_builder = <function sphinx_builder.<locals>._create_project at 0x73427f5c0900>
file_regression = <pytest_regressions.file_regression.FileRegressionFixture object at 0x73427f8ba2c0>
@pytest.mark.skipif(not MYST_INSTALLED, reason="myst-parser not installed")
def test_sd_custom_directives(
sphinx_builder: Callable[..., SphinxBuilder], file_regression
):
"""Test that the defaults are used."""
builder = sphinx_builder(
conf_kwargs={
"extensions": ["myst_parser", "sphinx_design"],
"sd_custom_directives": {
"dropdown-syntax": {
"inherit": "dropdown",
"argument": "Syntax",
"options": {
"color": "primary",
"icon": "code",
},
}
},
}
)
content = "# Heading\n\n```{dropdown-syntax}\ncontent\n```"
builder.src_path.joinpath("index.md").write_text(content, encoding="utf8")
builder.build()
doctree = builder.get_doctree("index", post_transforms=False)
doctree.attributes.pop("translation_progress", None) # added in sphinx 7.1
> file_regression.check(
doctree.pformat(),
basename="sd_custom_directives",
extension=".xml",
encoding="utf8",
)
E AssertionError: FILES DIFFER:
E /tmp/pytest-of-pbuilder/pytest-0/test_sd_custom_directives0/test_snippets/sd_custom_directives.xml
E /tmp/pytest-of-pbuilder/pytest-0/test_sd_custom_directives0/test_snippets/sd_custom_directives.obtained.xml
E HTML DIFF: /tmp/pytest-of-pbuilder/pytest-0/test_sd_custom_directives0/test_snippets/sd_custom_directives.obtained.diff.html
E ---
E +++
E @@ -2,7 +2,7 @@
E <section ids="heading" names="heading">
E <title>
E Heading
E - <container body_classes="" chevron="True" container_classes="sd-mb-3" design_component="dropdown" has_title="True" icon="code" is_div="True" opened="False" title_classes="sd-bg-primary sd-bg-text-primary" type="dropdown">
E + <container body_classes="" chevron="True" container_classes="sd-mb-3" design_component="dropdown" has_title="1" icon="code" is_div="1" opened="0" title_classes="sd-bg-primary sd-bg-text-primary" type="dropdown">
E <rubric>
E Syntax
E <paragraph>
tests/test_snippets.py:190: AssertionError
=============================== warnings summary ===============================
tests/test_snippets.py::test_sd_hide_title_rst
tests/test_snippets.py::test_sd_hide_title_myst
tests/test_snippets.py::test_sd_custom_directives1 parent b3d6edd commit 86f62b6
File tree
3 files changed
+5
-5
lines changed- tests/test_snippets
3 files changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
0 commit comments