From a33939f5c30309475e72ac4a28d0f2e95c18695d Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Tue, 1 Nov 2016 06:31:47 -0700 Subject: [PATCH] Remove unused, open files at top level of tests. The data read from the file was unused. The files remained opened and were never explicitly closed. Fixes some instances of warnings during tests: "ResourceWarning: unclosed file ..." --- Tests/test_file_fli.py | 1 - Tests/test_file_icns.py | 1 - Tests/test_file_ico.py | 1 - Tests/test_file_png.py | 1 - Tests/test_file_ppm.py | 1 - Tests/test_file_psd.py | 1 - 6 files changed, 6 deletions(-) diff --git a/Tests/test_file_fli.py b/Tests/test_file_fli.py index 5ce4839bc..a49301de1 100644 --- a/Tests/test_file_fli.py +++ b/Tests/test_file_fli.py @@ -6,7 +6,6 @@ from PIL import Image, FliImagePlugin # created as an export of a palette image from Gimp2.6 # save as...-> hopper.fli, default options. test_file = "Tests/images/hopper.fli" -data = open(test_file, "rb").read() class TestFileFli(PillowTestCase): diff --git a/Tests/test_file_icns.py b/Tests/test_file_icns.py index 7332db964..92fe136f2 100644 --- a/Tests/test_file_icns.py +++ b/Tests/test_file_icns.py @@ -6,7 +6,6 @@ import sys # sample icon file TEST_FILE = "Tests/images/pillow.icns" -data = open(TEST_FILE, "rb").read() enable_jpeg2k = hasattr(Image.core, 'jp2klib_version') diff --git a/Tests/test_file_ico.py b/Tests/test_file_ico.py index 806cff66f..94b8c44e3 100644 --- a/Tests/test_file_ico.py +++ b/Tests/test_file_ico.py @@ -5,7 +5,6 @@ from PIL import Image, IcoImagePlugin # sample ppm stream TEST_ICO_FILE = "Tests/images/hopper.ico" -TEST_DATA = open(TEST_ICO_FILE, "rb").read() class TestFileIco(PillowTestCase): diff --git a/Tests/test_file_png.py b/Tests/test_file_png.py index a96422fa7..54250d15a 100644 --- a/Tests/test_file_png.py +++ b/Tests/test_file_png.py @@ -12,7 +12,6 @@ codecs = dir(Image.core) # sample png stream TEST_PNG_FILE = "Tests/images/hopper.png" -TEST_DATA = open(TEST_PNG_FILE, "rb").read() # stuff to create inline PNG images diff --git a/Tests/test_file_ppm.py b/Tests/test_file_ppm.py index 817a62393..e7428f88d 100644 --- a/Tests/test_file_ppm.py +++ b/Tests/test_file_ppm.py @@ -4,7 +4,6 @@ from PIL import Image # sample ppm stream test_file = "Tests/images/hopper.ppm" -data = open(test_file, "rb").read() class TestFilePpm(PillowTestCase): diff --git a/Tests/test_file_psd.py b/Tests/test_file_psd.py index 6bf34cf78..2b4825734 100644 --- a/Tests/test_file_psd.py +++ b/Tests/test_file_psd.py @@ -4,7 +4,6 @@ from PIL import Image, PsdImagePlugin # sample ppm stream test_file = "Tests/images/hopper.psd" -data = open(test_file, "rb").read() class TestImagePsd(PillowTestCase):