File: check_libtiff_segfault.py

package info (click to toggle)
pillow 8.1.2%2Bdfsg-0.3%2Bdeb11u2
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 65,628 kB
  • sloc: python: 35,630; ansic: 31,009; makefile: 388; javascript: 114; sh: 77
file content (15 lines) | stat: -rw-r--r-- 313 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import pytest

from PIL import Image

TEST_FILE = "Tests/images/libtiff_segfault.tif"


def test_libtiff_segfault():
    """This test should not segfault. It will on Pillow <= 3.1.0 and
    libtiff >= 4.0.0
    """

    with pytest.raises(OSError):
        with Image.open(TEST_FILE) as im:
            im.load()