Cleanup .spider extension in the same test where it is added (#9517)

This commit is contained in:
Hugo van Kemenade 2026-03-31 15:55:30 +03:00 committed by GitHub
commit d66a77223b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,10 +14,6 @@ from .helper import assert_image_equal, hopper, is_pypy
TEST_FILE = "Tests/images/hopper.spider"
def teardown_module() -> None:
Image.EXTENSION.pop(".spider", None)
def test_sanity() -> None:
with Image.open(TEST_FILE) as im:
im.load()
@ -67,6 +63,8 @@ def test_save(tmp_path: Path) -> None:
assert im2.size == (128, 128)
assert im2.format == "SPIDER"
del Image.EXTENSION[".spider"]
@pytest.mark.parametrize("size", ((0, 1), (1, 0), (0, 0)))
def test_save_zero(size: tuple[int, int]) -> None: