diff --git a/Tests/test_image_draft.py b/Tests/test_image_draft.py index c7cd90e95..68676687c 100644 --- a/Tests/test_image_draft.py +++ b/Tests/test_image_draft.py @@ -2,13 +2,13 @@ from helper import unittest, PillowTestCase, fromstring, tostring from PIL import Image -codecs = dir(Image.core) -fihopperme = "Tests/images/hopper.jpg" -data = tostring(Image.open(fihopperme).resize((512, 512)), "JPEG") +CODECS = dir(Image.core) +FILENAME = "Tests/images/hopper.jpg" +DATA = tostring(Image.open(FILENAME).resize((512, 512)), "JPEG") def draft(mode, size): - im = fromstring(data) + im = fromstring(DATA) im.draft(mode, size) return im @@ -16,7 +16,7 @@ def draft(mode, size): class TestImageDraft(PillowTestCase): def setUp(self): - if "jpeg_encoder" not in codecs or "jpeg_decoder" not in codecs: + if "jpeg_encoder" not in CODECS or "jpeg_decoder" not in CODECS: self.skipTest("jpeg support not available") def test_size(self): diff --git a/Tests/test_mode_i16.py b/Tests/test_mode_i16.py index 4c6c181a8..0bd2b9a86 100644 --- a/Tests/test_mode_i16.py +++ b/Tests/test_mode_i16.py @@ -39,10 +39,10 @@ class TestModeI16(PillowTestCase): imOut = imIn.transform((w, h), Image.EXTENT, (0, 0, w, h)) self.verify(imOut) # transform - fihopperme = self.tempfile("temp.im") - imIn.save(fihopperme) + filename = self.tempfile("temp.im") + imIn.save(filename) - imOut = Image.open(fihopperme) + imOut = Image.open(filename) self.verify(imIn) self.verify(imOut) diff --git a/Tests/test_pickle.py b/Tests/test_pickle.py index 595141cb7..59dfd5948 100644 --- a/Tests/test_pickle.py +++ b/Tests/test_pickle.py @@ -6,13 +6,14 @@ from PIL import Image class TestPickle(PillowTestCase): def helper_pickle_file(self, pickle, protocol=0): + # Arrange im = Image.open('Tests/images/hopper.jpg') - fihopperme = self.tempfile('temp.pkl') + filename = self.tempfile('temp.pkl') # Act - with open(fihopperme, 'wb') as f: + with open(filename, 'wb') as f: pickle.dump(im, f, protocol) - with open(fihopperme, 'rb') as f: + with open(filename, 'rb') as f: loaded_im = pickle.load(f) # Assert