Skip to content

Commit e3aeaa6

Browse files
authored
Merge pull request #7911 from Yay295/fix_unclosed_images
Use setup_module() to open images so they aren't opened if skipped
2 parents 3f49b0c + 0d86da5 commit e3aeaa6

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

Tests/test_image_fromqimage.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@
1616
not ImageQt.qt_is_installed, reason="Qt bindings are not installed"
1717
)
1818

19-
ims = [
20-
hopper(),
21-
Image.open("Tests/images/transparent.png"),
22-
Image.open("Tests/images/7x13.png"),
23-
]
19+
ims: list[Image.Image] = []
20+
21+
22+
def setup_module() -> None:
23+
ims.append(hopper())
24+
ims.append(Image.open("Tests/images/transparent.png"))
25+
ims.append(Image.open("Tests/images/7x13.png"))
2426

2527

2628
def teardown_module() -> None:

0 commit comments

Comments
 (0)