mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-02 02:43:06 +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
|
# check putpixel
|
||||||
im = Image.new(mode, (1, 1), None)
|
im = Image.new(mode, (1, 1), None)
|
||||||
im.putpixel((0, 0), c)
|
im.putpixel((0, 0), c)
|
||||||
|
d = im.getpixel((0, 0))
|
||||||
assert (
|
assert (
|
||||||
im.getpixel((0, 0)) == c
|
d == c
|
||||||
), f"put/getpixel roundtrip failed for mode {mode}, color {c}"
|
), f"put/getpixel roundtrip failed for mode {mode}, expected {c} got {d}"
|
||||||
|
|
||||||
# check putpixel negative index
|
# check putpixel negative index
|
||||||
im.putpixel((-1, -1), c)
|
im.putpixel((-1, -1), c)
|
||||||
assert (
|
d = im.getpixel((-1, -1))
|
||||||
im.getpixel((-1, -1)) == c
|
assert d == c, (
|
||||||
), f"put/getpixel roundtrip negative index failed for mode {mode}, color {c}"
|
f"put/getpixel roundtrip negative index failed for mode {mode}, "
|
||||||
|
f"expected {c} got {d}"
|
||||||
|
)
|
||||||
|
|
||||||
# Check 0
|
# Check 0
|
||||||
im = Image.new(mode, (0, 0), None)
|
im = Image.new(mode, (0, 0), None)
|
||||||
|
@ -166,13 +169,15 @@ class TestImageGetPixel(AccessTest):
|
||||||
|
|
||||||
# check initial color
|
# check initial color
|
||||||
im = Image.new(mode, (1, 1), c)
|
im = Image.new(mode, (1, 1), c)
|
||||||
assert (
|
d = im.getpixel((0, 0))
|
||||||
im.getpixel((0, 0)) == c
|
assert d == c, f"initial color failed for mode {mode}, expected {c} got {d}"
|
||||||
), f"initial color failed for mode {mode}, color {c} "
|
|
||||||
# check initial color negative index
|
# check initial color negative index
|
||||||
assert (
|
d = im.getpixel((-1, -1))
|
||||||
im.getpixel((-1, -1)) == c
|
assert d == c, (
|
||||||
), f"initial color failed with negative index for mode {mode}, color {c} "
|
f"initial color failed with negative index for mode {mode}, "
|
||||||
|
f"expected {c} got {d}"
|
||||||
|
)
|
||||||
|
|
||||||
# Check 0
|
# Check 0
|
||||||
im = Image.new(mode, (0, 0), c)
|
im = Image.new(mode, (0, 0), c)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user