Skip to content

Commit 9aaaa41

Browse files
committed
Monkeypatch SphinxTransformer.apply_transforms
1 parent 9195105 commit 9aaaa41

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

tests/test_renderers/test_fixtures_sphinx.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import pytest
1414
from docutils.core import Publisher
1515
from pytest_param_files import ParamTestData
16+
from sphinx.transforms import SphinxTransformer
1617
from sphinx_pytest.plugin import CreateDoctree
1718

1819
from myst_parser.mdit_to_docutils.sphinx_ import SphinxRenderer
@@ -31,6 +32,8 @@ def _apply_transforms(self):
3132

3233
if "[APPLY TRANSFORMS]" not in file_params.title:
3334
monkeypatch.setattr(Publisher, "apply_transforms", _apply_transforms)
35+
# in sphinx >= 9.0.0 SphinxTransformer is used
36+
monkeypatch.setattr(SphinxTransformer, "apply_transforms", _apply_transforms)
3437

3538
result = sphinx_doctree(file_params.content, "index.md")
3639
pformat = result.pformat("index")

0 commit comments

Comments
 (0)