Merge branch 'master' into master

This commit is contained in:
Hugo van Kemenade 2020-08-09 13:57:46 +03:00 committed by GitHub
commit cb26b4d40f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
135 changed files with 204 additions and 47 deletions

View File

@ -9,35 +9,35 @@ repos:
types: []
- repo: https://github.com/timothycrosley/isort
rev: 7c29dd9d55161704cfc45998c6f5c2c43d39264b # frozen: 4.3.21
rev: 9ae09866e278fbc6ec0383ccb16b5c84e78e6e4d # frozen: 5.3.2
hooks:
- id: isort
- repo: https://github.com/asottile/yesqa
rev: b13a51aa54142c59219c764e9f9362c049b439ed # frozen: v1.2.0
rev: 7a009f3ee493c796827ee334f9058b110a0e0db8 # frozen: v1.2.1
hooks:
- id: yesqa
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: ffbd448645bad2e7ca13f96fca5830058d27ccd5 # frozen: v1.1.7
rev: f30f4974a08a6b2f6a1eeaf30a4d501cf909163a # frozen: v1.1.9
hooks:
- id: remove-tabs
exclude: (Makefile$|\.bat$|\.cmake$|\.eps$|\.fits$|\.opt$)
- repo: https://gitlab.com/pycqa/flake8
rev: 735cfe7e1c57a8e05f660ba75de72313005af54a # frozen: 3.8.2
rev: 05f6544aef321e2fee03a1277ce2eef8880fb927 # frozen: 3.8.3
hooks:
- id: flake8
additional_dependencies: [flake8-2020, flake8-implicit-str-concat]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: 0d7d077d6ed5624854f93ac601739c1804ebeb98 # frozen: v1.5.1
rev: 20b9ac745c5adaab12b845b3564c773dcc051d0e # frozen: v1.5.2
hooks:
- id: python-check-blanket-noqa
- id: rst-backticks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: ebc15addedad713c86ef18ae9632c88e187dd0af # frozen: v3.1.0
rev: e1668fe86af3810fbca72b8653fe478e66a0afdc # frozen: v3.2.0
hooks:
- id: check-merge-conflict
- id: check-yaml

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python
import pytest
from PIL import Image
from .helper import is_win32
@ -11,7 +12,7 @@ pytestmark = pytest.mark.skipif(is_win32(), reason="requires Unix or macOS")
def _get_mem_usage():
from resource import getpagesize, getrusage, RUSAGE_SELF
from resource import RUSAGE_SELF, getpagesize, getrusage
mem = getrusage(RUSAGE_SELF).ru_maxrss
return mem * getpagesize() / 1024 / 1024

View File

@ -1,6 +1,7 @@
from io import BytesIO
import pytest
from PIL import Image
from .helper import is_win32, skip_unless_feature
@ -18,7 +19,7 @@ pytestmark = [
def test_leak_load():
from resource import setrlimit, RLIMIT_AS, RLIMIT_STACK
from resource import RLIMIT_AS, RLIMIT_STACK, setrlimit
setrlimit(RLIMIT_STACK, (stack_size, stack_size))
setrlimit(RLIMIT_AS, (mem_limit, mem_limit))
@ -28,7 +29,7 @@ def test_leak_load():
def test_leak_save():
from resource import setrlimit, RLIMIT_AS, RLIMIT_STACK
from resource import RLIMIT_AS, RLIMIT_STACK, setrlimit
setrlimit(RLIMIT_STACK, (stack_size, stack_size))
setrlimit(RLIMIT_AS, (mem_limit, mem_limit))

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image

View File

@ -1,6 +1,7 @@
import sys
import pytest
from PIL import Image
# This test is not run automatically.

View File

@ -1,6 +1,7 @@
import sys
import pytest
from PIL import Image
# This test is not run automatically.

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image
TEST_FILE = "Tests/images/libtiff_segfault.tif"

View File

@ -11,6 +11,7 @@ import tempfile
from io import BytesIO
import pytest
from PIL import Image, ImageMath, features
logger = logging.getLogger(__name__)
@ -184,7 +185,7 @@ class PillowLeakTestCase:
:returns: memory usage in kilobytes
"""
from resource import getrusage, RUSAGE_SELF
from resource import RUSAGE_SELF, getrusage
mem = getrusage(RUSAGE_SELF).ru_maxrss
if sys.platform == "darwin":

View File

@ -1,6 +1,7 @@
import os
import pytest
from PIL import Image
from .helper import assert_image_similar

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, ImageFilter
sample = Image.new("L", (7, 5))

View File

@ -1,6 +1,7 @@
from array import array
import pytest
from PIL import Image, ImageFilter
from .helper import assert_image_equal

View File

@ -1,6 +1,7 @@
import sys
import pytest
from PIL import Image
from .helper import is_pypy

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image
from .helper import hopper

View File

@ -2,6 +2,7 @@ import io
import re
import pytest
from PIL import features
from .helper import skip_unless_feature

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, ImageSequence, PngImagePlugin

View File

@ -1,6 +1,7 @@
import io
import pytest
from PIL import BmpImagePlugin, Image
from .helper import assert_image_equal, hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import BufrStubImagePlugin, Image
from .helper import hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import CurImagePlugin, Image
TEST_FILE = "Tests/images/deerstalker.cur"

View File

@ -1,4 +1,5 @@
import pytest
from PIL import DcxImagePlugin, Image
from .helper import assert_image_equal, hopper, is_pypy

View File

@ -2,6 +2,7 @@
from io import BytesIO
import pytest
from PIL import DdsImagePlugin, Image
from .helper import assert_image_equal

View File

@ -1,6 +1,7 @@
import io
import pytest
from PIL import EpsImagePlugin, Image, features
from .helper import assert_image_similar, hopper, skip_unless_feature

View File

@ -1,4 +1,5 @@
import pytest
from PIL import FitsStubImagePlugin, Image
TEST_FILE = "Tests/images/hopper.fits"

View File

@ -1,4 +1,5 @@
import pytest
from PIL import FliImagePlugin, Image
from .helper import assert_image_equal, is_pypy

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image
FpxImagePlugin = pytest.importorskip(

View File

@ -1,4 +1,5 @@
import pytest
from PIL import GbrImagePlugin, Image
from .helper import assert_image_equal

View File

@ -1,4 +1,5 @@
import pytest
from PIL import GdImageFile, UnidentifiedImageError
TEST_GD_FILE = "Tests/images/hopper.gd"

View File

@ -1,6 +1,7 @@
from io import BytesIO
import pytest
from PIL import GifImagePlugin, Image, ImageDraw, ImagePalette, features
from .helper import (

View File

@ -1,4 +1,5 @@
import pytest
from PIL.GimpPaletteFile import GimpPaletteFile

View File

@ -1,4 +1,5 @@
import pytest
from PIL import GribStubImagePlugin, Image
from .helper import hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Hdf5StubImagePlugin, Image
TEST_FILE = "Tests/images/hdf5.h5"

View File

@ -2,6 +2,7 @@ import io
import sys
import pytest
from PIL import IcnsImagePlugin, Image, features
from .helper import assert_image_equal, assert_image_similar

View File

@ -1,6 +1,7 @@
import io
import pytest
from PIL import IcoImagePlugin, Image, ImageDraw
from .helper import assert_image_equal, hopper

View File

@ -1,6 +1,7 @@
import filecmp
import pytest
from PIL import Image, ImImagePlugin
from .helper import assert_image_equal, hopper, is_pypy

View File

@ -3,6 +3,7 @@ import re
from io import BytesIO
import pytest
from PIL import (
ExifTags,
Image,

View File

@ -2,6 +2,7 @@ import re
from io import BytesIO
import pytest
from PIL import Image, ImageFile, Jpeg2KImagePlugin, features
from .helper import (

View File

@ -7,6 +7,7 @@ from collections import namedtuple
from ctypes import c_float
import pytest
from PIL import Image, ImageFilter, TiffImagePlugin, TiffTags, features
from .helper import (

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, McIdasImagePlugin
from .helper import assert_image_equal

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, ImagePalette
from .helper import assert_image_similar, hopper, skip_unless_feature

View File

@ -1,6 +1,7 @@
from io import BytesIO
import pytest
from PIL import Image
from .helper import assert_image_similar, is_pypy, skip_unless_feature

View File

@ -1,6 +1,7 @@
import os
import pytest
from PIL import Image, MspImagePlugin
from .helper import assert_image_equal, hopper

View File

@ -2,6 +2,7 @@ import os.path
import subprocess
import pytest
from PIL import Image
from .helper import IMCONVERT, assert_image_equal, hopper, imagemagick_available

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, ImageFile, PcxImagePlugin
from .helper import assert_image_equal, hopper

View File

@ -5,6 +5,7 @@ import tempfile
import time
import pytest
from PIL import Image, PdfParser
from .helper import hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, PixarImagePlugin
from .helper import assert_image_similar, hopper

View File

@ -3,6 +3,7 @@ import zlib
from io import BytesIO
import pytest
from PIL import Image, ImageFile, PngImagePlugin, features
from .helper import (

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image
from .helper import assert_image_equal, assert_image_similar, hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, PsdImagePlugin
from .helper import assert_image_similar, hopper, is_pypy

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, SgiImagePlugin
from .helper import assert_image_equal, assert_image_similar, hopper

View File

@ -2,6 +2,7 @@ import tempfile
from io import BytesIO
import pytest
from PIL import Image, ImageSequence, SpiderImagePlugin
from .helper import assert_image_equal, hopper, is_pypy

View File

@ -1,6 +1,7 @@
import os
import pytest
from PIL import Image, SunImagePlugin
from .helper import assert_image_equal, assert_image_similar, hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, TarIO, features
from .helper import is_pypy

View File

@ -3,6 +3,7 @@ from glob import glob
from itertools import product
import pytest
from PIL import Image
from .helper import assert_image_equal, hopper

View File

@ -2,6 +2,7 @@ import os
from io import BytesIO
import pytest
from PIL import Image, TiffImagePlugin
from PIL.TiffImagePlugin import RESOLUTION_UNIT, X_RESOLUTION, Y_RESOLUTION

View File

@ -2,6 +2,7 @@ import io
import struct
import pytest
from PIL import Image, TiffImagePlugin, TiffTags
from PIL.TiffImagePlugin import IFDRational

View File

@ -2,6 +2,7 @@ import io
import re
import pytest
from PIL import Image, WebPImagePlugin, features
from .helper import (

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image
from .helper import assert_image_equal, assert_image_similar, hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image
from .helper import (

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image
from .helper import assert_image_equal, hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, WmfImagePlugin
from .helper import assert_image_similar, hopper

View File

@ -1,6 +1,7 @@
from io import BytesIO
import pytest
from PIL import Image
from .helper import hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, XpmImagePlugin
from .helper import assert_image_similar, hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, XVThumbImagePlugin
from .helper import assert_image_similar, hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import BdfFontFile, FontFile
filename = "Tests/images/courB08.bdf"

View File

@ -1,6 +1,7 @@
import os
import pytest
from PIL import FontFile, Image, ImageDraw, ImageFont, PcfFontFile
from .helper import assert_image_equal, assert_image_similar, skip_unless_feature

View File

@ -3,8 +3,9 @@ import os
import shutil
import tempfile
import PIL
import pytest
import PIL
from PIL import Image, ImageDraw, ImagePalette, ImageShow, UnidentifiedImageError
from .helper import (

View File

@ -4,9 +4,9 @@ import subprocess
import sys
import sysconfig
import pytest
from setuptools.command.build_ext import new_compiler
import pytest
from PIL import Image
from .helper import assert_image_equal, hopper, is_win32, on_ci
@ -17,8 +17,9 @@ if os.environ.get("PYTHONOPTIMIZE") == "2":
cffi = None
else:
try:
from PIL import PyAccess
import cffi
from PIL import PyAccess
except ImportError:
cffi = None

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image
from .helper import hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image
from .helper import assert_image, assert_image_equal, assert_image_similar, hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image
from .helper import assert_image_equal, hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, ImageFilter
from .helper import assert_image_equal, hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, ImageQt
from .helper import assert_image_equal, hopper

View File

@ -1,6 +1,7 @@
import os
import pytest
from PIL import Image
from .helper import hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import ImagePalette
from .helper import hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image
from .helper import assert_image, assert_image_similar, hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, ImageMath, ImageMode
from .helper import convert_to_comparable, skip_unless_feature

View File

@ -1,6 +1,7 @@
from contextlib import contextmanager
import pytest
from PIL import Image, ImageDraw
from .helper import assert_image_equal, assert_image_similar, hopper

View File

@ -4,6 +4,7 @@ Tests for resize functionality.
from itertools import permutations
import pytest
from PIL import Image
from .helper import assert_image_equal, assert_image_similar, hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image
from .helper import (

View File

@ -1,6 +1,7 @@
import math
import pytest
from PIL import Image, ImageTransform
from .helper import assert_image_equal, assert_image_similar, hopper

View File

@ -4,6 +4,7 @@ import re
from io import BytesIO
import pytest
from PIL import Image, ImageMode, features
from .helper import assert_image, assert_image_equal, assert_image_similar, hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, ImageColor

View File

@ -1,6 +1,7 @@
import os.path
import pytest
from PIL import Image, ImageColor, ImageDraw, ImageFont
from .helper import (

View File

@ -1,6 +1,7 @@
from io import BytesIO
import pytest
from PIL import EpsImagePlugin, Image, ImageFile, features
from .helper import (

View File

@ -7,6 +7,7 @@ from io import BytesIO
import pytest
from packaging.version import parse as parse_version
from PIL import Image, ImageDraw, ImageFont, features
from .helper import (

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, ImageDraw, ImageFont
from .helper import assert_image_similar

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, ImageDraw, ImageFont
from .helper import assert_image_similar, skip_unless_feature

View File

@ -3,6 +3,7 @@ import subprocess
import sys
import pytest
from PIL import Image, ImageGrab
from .helper import assert_image, assert_image_equal_tofile, skip_unless_feature

View File

@ -1,5 +1,6 @@
# Test the ImageMorphology functionality
import pytest
from PIL import Image, ImageMorph, _imagingmorph
from .helper import assert_image_equal, hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, ImageDraw, ImageOps, features
from .helper import (

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, ImageFilter

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, ImagePalette
from .helper import assert_image_equal

View File

@ -2,6 +2,7 @@ import array
import struct
import pytest
from PIL import Image, ImagePath

View File

@ -1,4 +1,5 @@
import pytest
from PIL import ImageQt
from .helper import hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, ImageSequence, TiffImagePlugin
from .helper import assert_image_equal, hopper, skip_unless_feature

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, ImageShow
from .helper import hopper, is_win32, on_ci

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, ImageStat
from .helper import hopper

View File

@ -1,13 +1,14 @@
import pytest
from PIL import Image
from .helper import assert_image_equal, hopper
try:
from PIL import ImageTk
import tkinter as tk
from PIL import ImageTk
dir(ImageTk)
HAS_TK = True
except (OSError, ImportError):

View File

@ -1,4 +1,5 @@
import pytest
from PIL import ImageWin
from .helper import hopper, is_win32

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image

View File

@ -1,6 +1,7 @@
import sys
import pytest
from PIL import Image
X = 255

Some files were not shown because too many files have changed in this diff Show More