From e2221de8f568b05d37dcea80effbcd0f5cd2a008 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Sun, 21 Apr 2013 10:18:32 +0200 Subject: [PATCH] Support (most of) test_image_split without PNG. If PNG (zlib) support is disabled, use .pcx for test_image_split which is unconditional. Since it does not support RGBA, skip the RGBA test. Otherwise, just use PNG and do the full test. --- Tests/test_image_split.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Tests/test_image_split.py b/Tests/test_image_split.py index 7fc70182b..07a779664 100644 --- a/Tests/test_image_split.py +++ b/Tests/test_image_split.py @@ -30,7 +30,13 @@ def test_split_merge(): assert_image_equal(lena("YCbCr"), split_merge("YCbCr")) def test_split_open(): - file = tempfile("temp.png") + codecs = dir(Image.core) + + if 'zip_encoder' in codecs: + file = tempfile("temp.png") + else: + file = tempfile("temp.pcx") + def split_open(mode): lena(mode).save(file) im = Image.open(file) @@ -39,4 +45,5 @@ def test_split_open(): assert_equal(split_open("L"), 1) assert_equal(split_open("P"), 1) assert_equal(split_open("RGB"), 3) - assert_equal(split_open("RGBA"), 4) + if 'zip_encoder' in codecs: + assert_equal(split_open("RGBA"), 4)