Skip to content

Commit

Permalink
Merge 4f68c29 into 98de727
Browse files Browse the repository at this point in the history
  • Loading branch information
jdufresne committed May 28, 2017
2 parents 98de727 + 4f68c29 commit 1088790
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
6 changes: 2 additions & 4 deletions Tests/test_file_libtiff.py
Expand Up @@ -532,10 +532,8 @@ def test_fd_duplication(self):
im = Image.open(tmpfile)
count = im.n_frames
im.close()
try:
os.remove(tmpfile) # Windows PermissionError here!
except:
self.fail("Should not get permission error here")
# Should not raise PermissionError.
os.remove(tmpfile)

def test_read_icc(self):
with Image.open("Tests/images/hopper.iccprofile.tif") as img:
Expand Down
7 changes: 2 additions & 5 deletions Tests/test_file_tiff.py
Expand Up @@ -144,11 +144,8 @@ def test_invalid_file(self):

def test_bad_exif(self):
i = Image.open('Tests/images/hopper_bad_exif.jpg')
try:
self.assert_warning(UserWarning, i._getexif)
except struct.error:
self.fail(
"Bad EXIF data passed incorrect values to _binary unpack")
# Should not raise struct.error.
self.assert_warning(UserWarning, i._getexif)

def test_save_rgba(self):
im = hopper("RGBA")
Expand Down
12 changes: 4 additions & 8 deletions Tests/test_file_tiff_metadata.py
Expand Up @@ -160,10 +160,8 @@ def test_empty_metadata(self):
f = io.BytesIO(b'II*\x00\x08\x00\x00\x00')
head = f.read(8)
info = TiffImagePlugin.ImageFileDirectory(head)
try:
self.assert_warning(UserWarning, lambda: info.load(f))
except struct.error:
self.fail("Should not be struct errors there.")
# Should not raise struct.error.
self.assert_warning(UserWarning, lambda: info.load(f))

def test_iccprofile(self):
# https://github.com/python-pillow/Pillow/issues/1462
Expand Down Expand Up @@ -214,10 +212,8 @@ def test_expty_values(self):
head = data.read(8)
info = TiffImagePlugin.ImageFileDirectory_v2(head)
info.load(data)
try:
info = dict(info)
except ValueError:
self.fail("Should not be struct value error there.")
# Should not raise ValueError.
info = dict(info)
self.assertIn(33432, info)


Expand Down

0 comments on commit 1088790

Please sign in to comment.