mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-03 13:14:27 +03:00
log expected & actual color in image access tests
This commit is contained in:
parent
50f5eade47
commit
7ad50d9185
|
@ -139,15 +139,18 @@ class TestImageGetPixel(AccessTest):
|
|||
# check putpixel
|
||||
im = Image.new(mode, (1, 1), None)
|
||||
im.putpixel((0, 0), c)
|
||||
d = im.getpixel((0, 0))
|
||||
assert (
|
||||
im.getpixel((0, 0)) == c
|
||||
), f"put/getpixel roundtrip failed for mode {mode}, color {c}"
|
||||
d == c
|
||||
), f"put/getpixel roundtrip failed for mode {mode}, expected {c} got {d}"
|
||||
|
||||
# check putpixel negative index
|
||||
im.putpixel((-1, -1), c)
|
||||
assert (
|
||||
im.getpixel((-1, -1)) == c
|
||||
), f"put/getpixel roundtrip negative index failed for mode {mode}, color {c}"
|
||||
d = im.getpixel((-1, -1))
|
||||
assert d == c, (
|
||||
f"put/getpixel roundtrip negative index failed for mode {mode}, "
|
||||
f"expected {c} got {d}"
|
||||
)
|
||||
|
||||
# Check 0
|
||||
im = Image.new(mode, (0, 0), None)
|
||||
|
@ -166,13 +169,15 @@ class TestImageGetPixel(AccessTest):
|
|||
|
||||
# check initial color
|
||||
im = Image.new(mode, (1, 1), c)
|
||||
assert (
|
||||
im.getpixel((0, 0)) == c
|
||||
), f"initial color failed for mode {mode}, color {c} "
|
||||
d = im.getpixel((0, 0))
|
||||
assert d == c, f"initial color failed for mode {mode}, expected {c} got {d}"
|
||||
|
||||
# check initial color negative index
|
||||
assert (
|
||||
im.getpixel((-1, -1)) == c
|
||||
), f"initial color failed with negative index for mode {mode}, color {c} "
|
||||
d = im.getpixel((-1, -1))
|
||||
assert d == c, (
|
||||
f"initial color failed with negative index for mode {mode}, "
|
||||
f"expected {c} got {d}"
|
||||
)
|
||||
|
||||
# Check 0
|
||||
im = Image.new(mode, (0, 0), c)
|
||||
|
|
Loading…
Reference in New Issue
Block a user