https://github.com/sphinx-doc/sphinx/commit/68d56109ff50dd81dd31d4a01e3dccbd006c50ee --- sphinx-7.4.7/tests/test_builders/test_build_latex.py.orig +++ sphinx-7.4.7/tests/test_builders/test_build_latex.py @@ -8,6 +8,7 @@ from shutil import copyfile from subprocess import CalledProcessError +import docutils import pygments import pytest @@ -1545,9 +1546,15 @@ result = (app.outdir / 'projectnamenotset.tex').read_text(encoding='utf8') + # ref: docutils r10151 + if docutils.__version_info__[:2] < (0, 22): + figure_id, table_id = 'id1', 'id2' + else: + figure_id, table_id = 'id2', 'id3' + # figures assert (r'\caption{labeled figure}' - r'\label{\detokenize{index:id1}}' + r'\label{\detokenize{index:' + figure_id + '}}' r'\label{\detokenize{index:figure2}}' r'\label{\detokenize{index:figure1}}' r'\end{figure}' in result) @@ -1566,7 +1573,7 @@ # tables assert (r'\sphinxcaption{table caption}' - r'\label{\detokenize{index:id2}}' + r'\label{\detokenize{index:' + table_id + '}}' r'\label{\detokenize{index:table2}}' r'\label{\detokenize{index:table1}}' in result) assert (r'\sphinxcaption{table caption}'