File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed
Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 44from typing import List
55
66import pytest
7+ import sphinx
78
89from sphinx .application import Sphinx
910
@@ -13,7 +14,10 @@ def test_image_latex_then_html(
1314 content : Sphinx , tex_images : List [Path ], make_app_with_local_user_config
1415):
1516 box_pdf = tex_images [0 ]
16- assert box_pdf .basename () == "box.pdf"
17+ if sphinx .version_info [:2 ] < (7 , 2 ):
18+ assert box_pdf .basename () == "box.pdf"
19+ else :
20+ assert box_pdf .name == "box.pdf"
1721 assert box_pdf .exists ()
1822 html_app = make_app_with_local_user_config (srcdir = content .srcdir )
1923 html_app .build ()
Original file line number Diff line number Diff line change 22from typing import List
33
44import pytest
5+ import sphinx
56
67from bs4 import Tag
78
1415def test_pdfnoconvert (tex_images : List [Path ]):
1516 (image ,) = tex_images
1617 # It should not convert a PDF into another format.
17- assert image .basename () == "box.pdf"
18+ if sphinx .version_info [:2 ] < (7 , 2 ):
19+ assert image .basename () == "box.pdf"
20+ else :
21+ assert image .name == "box.pdf"
1822
1923
2024@pytest .mark .sphinx ("html" , testroot = "imgconverter" )
Original file line number Diff line number Diff line change 11import re
2+ import sphinx
23from pathlib import Path
34from typing import List
45
89@pytest .mark .sphinx ("latex" , testroot = "image" , srcdir = "pdf_image" )
910def test_pdf_image (tex_images : List [Path ]):
1011 (image ,) = tex_images
11- assert image .basename () == "box.pdf"
12+ if sphinx .version_info [:2 ] < (7 , 2 ):
13+ assert image .basename () == "box.pdf"
14+ else :
15+ assert image .name == "box.pdf"
1216
1317
1418@pytest .mark .sphinx ("latex" , testroot = "image" , srcdir = "pdf_image_crop" )
You can’t perform that action at this time.
0 commit comments