From 9c6b30560e6ac3b17e9053d1a4e2c1af3508e339 Mon Sep 17 00:00:00 2001 From: Yay295 Date: Wed, 27 Mar 2024 10:51:33 -0500 Subject: [PATCH] use setup_module() to open images so they aren't opened if skipped --- Tests/test_image_fromqimage.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Tests/test_image_fromqimage.py b/Tests/test_image_fromqimage.py index c20123a1b..e214e58f9 100644 --- a/Tests/test_image_fromqimage.py +++ b/Tests/test_image_fromqimage.py @@ -16,13 +16,14 @@ pytestmark = pytest.mark.skipif( not ImageQt.qt_is_installed, reason="Qt bindings are not installed" ) -ims = [ - hopper(), - Image.open("Tests/images/transparent.png"), - Image.open("Tests/images/7x13.png"), -] +ims = [] +def setup_module() -> None: + ims.append(hopper()) + ims.append(Image.open("Tests/images/transparent.png")) + ims.append(Image.open("Tests/images/7x13.png")) + def teardown_module() -> None: for im in ims: im.close()