mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-11 16:52:29 +03:00
don't use bare asserts, don't mask file builtin with local
This commit is contained in:
parent
e1e64904c7
commit
0492409def
|
@ -255,22 +255,22 @@ def test_save_icc_profile_none():
|
||||||
# check saving files with an ICC profile set to None (omit profile)
|
# check saving files with an ICC profile set to None (omit profile)
|
||||||
in_file = "Tests/images/icc_profile_none.png"
|
in_file = "Tests/images/icc_profile_none.png"
|
||||||
im = Image.open(in_file)
|
im = Image.open(in_file)
|
||||||
assert im.info['icc_profile'] is None
|
assert_equal(im.info['icc_profile'], None)
|
||||||
|
|
||||||
file = tempfile("temp.png")
|
f = tempfile("temp.png")
|
||||||
assert_no_exception(lambda: im.save(file))
|
assert_no_exception(lambda: im.save(f))
|
||||||
im = Image.open(file)
|
im = Image.open(f)
|
||||||
assert 'icc_profile' not in im.info
|
assert_false('icc_profile' in im.info)
|
||||||
|
|
||||||
def test_save_icc_profile_exists():
|
def test_save_icc_profile_exists():
|
||||||
# check icc profile is kept during save()
|
# check icc profile is kept during save()
|
||||||
in_file = "Tests/images/trollface.png"
|
in_file = "Tests/images/trollface.png"
|
||||||
im = Image.open(in_file)
|
im = Image.open(in_file)
|
||||||
orig_profile = im.info['icc_profile']
|
orig_profile = im.info['icc_profile']
|
||||||
assert len(orig_profile) == 6636
|
assert_equal(len(orig_profile), 6636)
|
||||||
|
|
||||||
file = tempfile("temp.png")
|
f = tempfile("temp.png")
|
||||||
assert_no_exception(lambda: im.save(file))
|
assert_no_exception(lambda: im.save(f))
|
||||||
|
|
||||||
im = Image.open(file)
|
im = Image.open(f)
|
||||||
assert im.info['icc_profile'] == orig_profile
|
assert_equal(im.info['icc_profile'], orig_profile)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user