File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 1212from subprocess import CalledProcessError
1313from typing import TYPE_CHECKING
1414
15+ import docutils
1516import pygments
1617import pytest
1718
@@ -1959,10 +1960,16 @@ def test_latex_labels(app: SphinxTestApp) -> None:
19591960
19601961 result = (app .outdir / 'projectnamenotset.tex' ).read_text (encoding = 'utf8' )
19611962
1963+ # ref: docutils r10151
1964+ if docutils .__version_info__ [:2 ] < (0 , 22 ):
1965+ figure_id , table_id = 'id1' , 'id2'
1966+ else :
1967+ figure_id , table_id = 'id2' , 'id3'
1968+
19621969 # figures
19631970 assert (
19641971 r'\caption{labeled figure}'
1965- r'\label{\detokenize{index:id1 }}'
1972+ r'\label{\detokenize{index:' + figure_id + ' }}'
19661973 r'\label{\detokenize{index:figure2}}'
19671974 r'\label{\detokenize{index:figure1}}'
19681975 r'\end{figure}'
@@ -1988,7 +1995,7 @@ def test_latex_labels(app: SphinxTestApp) -> None:
19881995 # tables
19891996 assert (
19901997 r'\sphinxcaption{table caption}'
1991- r'\label{\detokenize{index:id2 }}'
1998+ r'\label{\detokenize{index:' + table_id + ' }}'
19921999 r'\label{\detokenize{index:table2}}'
19932000 r'\label{\detokenize{index:table1}}'
19942001 ) in result
You can’t perform that action at this time.
0 commit comments