mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-06-05 21:53:15 +03:00
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 ..."
This commit is contained in:
parent
33adc640cd
commit
a33939f5c3
|
@ -6,7 +6,6 @@ from PIL import Image, FliImagePlugin
|
||||||
# created as an export of a palette image from Gimp2.6
|
# created as an export of a palette image from Gimp2.6
|
||||||
# save as...-> hopper.fli, default options.
|
# save as...-> hopper.fli, default options.
|
||||||
test_file = "Tests/images/hopper.fli"
|
test_file = "Tests/images/hopper.fli"
|
||||||
data = open(test_file, "rb").read()
|
|
||||||
|
|
||||||
|
|
||||||
class TestFileFli(PillowTestCase):
|
class TestFileFli(PillowTestCase):
|
||||||
|
|
|
@ -6,7 +6,6 @@ import sys
|
||||||
|
|
||||||
# sample icon file
|
# sample icon file
|
||||||
TEST_FILE = "Tests/images/pillow.icns"
|
TEST_FILE = "Tests/images/pillow.icns"
|
||||||
data = open(TEST_FILE, "rb").read()
|
|
||||||
|
|
||||||
enable_jpeg2k = hasattr(Image.core, 'jp2klib_version')
|
enable_jpeg2k = hasattr(Image.core, 'jp2klib_version')
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ from PIL import Image, IcoImagePlugin
|
||||||
|
|
||||||
# sample ppm stream
|
# sample ppm stream
|
||||||
TEST_ICO_FILE = "Tests/images/hopper.ico"
|
TEST_ICO_FILE = "Tests/images/hopper.ico"
|
||||||
TEST_DATA = open(TEST_ICO_FILE, "rb").read()
|
|
||||||
|
|
||||||
|
|
||||||
class TestFileIco(PillowTestCase):
|
class TestFileIco(PillowTestCase):
|
||||||
|
|
|
@ -12,7 +12,6 @@ codecs = dir(Image.core)
|
||||||
# sample png stream
|
# sample png stream
|
||||||
|
|
||||||
TEST_PNG_FILE = "Tests/images/hopper.png"
|
TEST_PNG_FILE = "Tests/images/hopper.png"
|
||||||
TEST_DATA = open(TEST_PNG_FILE, "rb").read()
|
|
||||||
|
|
||||||
# stuff to create inline PNG images
|
# stuff to create inline PNG images
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ from PIL import Image
|
||||||
|
|
||||||
# sample ppm stream
|
# sample ppm stream
|
||||||
test_file = "Tests/images/hopper.ppm"
|
test_file = "Tests/images/hopper.ppm"
|
||||||
data = open(test_file, "rb").read()
|
|
||||||
|
|
||||||
|
|
||||||
class TestFilePpm(PillowTestCase):
|
class TestFilePpm(PillowTestCase):
|
||||||
|
|
|
@ -4,7 +4,6 @@ from PIL import Image, PsdImagePlugin
|
||||||
|
|
||||||
# sample ppm stream
|
# sample ppm stream
|
||||||
test_file = "Tests/images/hopper.psd"
|
test_file = "Tests/images/hopper.psd"
|
||||||
data = open(test_file, "rb").read()
|
|
||||||
|
|
||||||
|
|
||||||
class TestImagePsd(PillowTestCase):
|
class TestImagePsd(PillowTestCase):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user