mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-25 00:34:14 +03:00
Merge pull request #5686 from hugovk/fix-test-warnings
Fix/filter/avoid test warnings
This commit is contained in:
commit
8b639f7546
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -83,6 +83,7 @@ docs/_build/
|
|||
Tests/images/README.md
|
||||
Tests/images/crash_1.tif
|
||||
Tests/images/crash_2.tif
|
||||
Tests/images/crash-81154a65438ba5aaeca73fd502fa4850fbde60f8.tif
|
||||
Tests/images/string_dimension.tiff
|
||||
Tests/images/jpeg2000
|
||||
Tests/images/msp
|
||||
|
|
|
@ -698,6 +698,8 @@ class TestFileTiff:
|
|||
# Ignore this UserWarning which triggers for four tags:
|
||||
# "Possibly corrupt EXIF data. Expecting to read 50404352 bytes but..."
|
||||
@pytest.mark.filterwarnings("ignore:Possibly corrupt EXIF data")
|
||||
# Ignore this UserWarning:
|
||||
@pytest.mark.filterwarnings("ignore:Truncated File Read")
|
||||
@pytest.mark.skipif(
|
||||
not os.path.exists("Tests/images/string_dimension.tiff"),
|
||||
reason="Extra image files not installed",
|
||||
|
|
|
@ -16,10 +16,10 @@ def test_sanity():
|
|||
|
||||
|
||||
def test_reload():
|
||||
im = Image.open("Tests/images/hopper.gif")
|
||||
original = im.copy()
|
||||
im.palette.dirty = 1
|
||||
assert_image_equal(im.convert("RGB"), original.convert("RGB"))
|
||||
with Image.open("Tests/images/hopper.gif") as im:
|
||||
original = im.copy()
|
||||
im.palette.dirty = 1
|
||||
assert_image_equal(im.convert("RGB"), original.convert("RGB"))
|
||||
|
||||
|
||||
def test_getcolor():
|
||||
|
|
|
@ -24,11 +24,17 @@ def test_overflow():
|
|||
|
||||
|
||||
def test_tobytes():
|
||||
# Note that this image triggers the decompression bomb warning:
|
||||
max_pixels = Image.MAX_IMAGE_PIXELS
|
||||
Image.MAX_IMAGE_PIXELS = None
|
||||
|
||||
# Previously raised an access violation on Windows
|
||||
with Image.open("Tests/images/l2rgb_read.bmp") as im:
|
||||
with pytest.raises((ValueError, MemoryError, OSError)):
|
||||
im.tobytes()
|
||||
|
||||
Image.MAX_IMAGE_PIXELS = max_pixels
|
||||
|
||||
|
||||
@pytest.mark.skipif(sys.maxsize <= 2 ** 32, reason="Requires 64-bit system")
|
||||
def test_ysize():
|
||||
|
|
|
@ -40,6 +40,7 @@ from .helper import on_ci
|
|||
)
|
||||
@pytest.mark.filterwarnings("ignore:Possibly corrupt EXIF data")
|
||||
@pytest.mark.filterwarnings("ignore:Metadata warning")
|
||||
@pytest.mark.filterwarnings("ignore:Truncated File Read")
|
||||
def test_tiff_crashes(test_file):
|
||||
try:
|
||||
with Image.open(test_file) as im:
|
||||
|
|
Loading…
Reference in New Issue
Block a user