Disallow untyped defs in `tests/test_util/test_util_images.py` (#13543)

Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
This commit is contained in:
Adam DangoorandAdam Turner authored and GitHub committed 2025-05-12 17:31:12 +01:00
1 parent ad85bf8a4d
commit 5a73bf6af0
2 files changed
+5 -2

No files matched your search

-1
View File
@@ -290,7 +290,6 @@ module = [
"tests.test_util.test_util",
"tests.test_util.test_util_display",
"tests.test_util.test_util_docutils",
"tests.test_util.test_util_images",
"tests.test_util.test_util_inventory",
# tests/test_writers
"tests.test_writers.test_docutilsconf",
+5 -1
View File
@@ -11,13 +11,17 @@ from sphinx.util.images import (
parse_data_uri,
)
TYPE_CHECKING = False
if TYPE_CHECKING:
from pathlib import Path
GIF_FILENAME = 'img.gif'
PNG_FILENAME = 'img.png'
PDF_FILENAME = 'img.pdf'
TXT_FILENAME = 'index.txt'
def test_get_image_size(rootdir):
def test_get_image_size(rootdir: Path) -> None:
assert get_image_size(rootdir / 'test-root' / GIF_FILENAME) == (200, 181)
assert get_image_size(rootdir / 'test-root' / PNG_FILENAME) == (200, 181)
assert get_image_size(rootdir / 'test-root' / PDF_FILENAME) is None