mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
For pickling, test with Image's __eq__. Everything else can use the old assert_image_equal.
This commit is contained in:
parent
2a6f2c5442
commit
8794c46318
|
@ -14,7 +14,7 @@ def helper_test_pickle_file(pickle, protocol=0):
|
|||
loaded_im = pickle.load(f)
|
||||
|
||||
# Assert
|
||||
assert_image_equal(im, loaded_im)
|
||||
assert_image_completely_equal(im, loaded_im)
|
||||
|
||||
|
||||
def helper_test_pickle_string(pickle, protocol=0, file='Images/lena.jpg'):
|
||||
|
@ -25,7 +25,7 @@ def helper_test_pickle_string(pickle, protocol=0, file='Images/lena.jpg'):
|
|||
loaded_im = pickle.loads(dumped_string)
|
||||
|
||||
# Assert
|
||||
assert_image_equal(im, loaded_im)
|
||||
assert_image_completely_equal(im, loaded_im)
|
||||
|
||||
|
||||
def test_pickle_image():
|
||||
|
|
|
@ -242,7 +242,12 @@ def assert_image_equal(a, b, msg=None):
|
|||
failure(msg or "got size %r, expected %r" % (a.size, b.size))
|
||||
elif a.tobytes() != b.tobytes():
|
||||
failure(msg or "got different content")
|
||||
elif a != b:
|
||||
else:
|
||||
success()
|
||||
|
||||
|
||||
def assert_image_completely_equal(a, b, msg=None):
|
||||
if a != b:
|
||||
failure(msg or "images different")
|
||||
else:
|
||||
success()
|
||||
|
|
Loading…
Reference in New Issue
Block a user