Skip to content

Commit

Permalink
Merge pull request #4 from radarhere/load-before-deepcopy
Browse files Browse the repository at this point in the history
Moved test to test_image_copy.py
  • Loading branch information
bigcat88 committed Apr 23, 2023
2 parents b10379b + b62287d commit dbfe2fb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
9 changes: 8 additions & 1 deletion Tests/test_image_copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from PIL import Image

from .helper import hopper
from .helper import hopper, skip_unless_feature


@pytest.mark.parametrize("mode", ("1", "P", "L", "RGB", "I", "F"))
Expand Down Expand Up @@ -42,3 +42,10 @@ def test_copy_zero():
out = im.copy()
assert out.mode == im.mode
assert out.size == im.size


@skip_unless_feature("libtiff")
def test_deepcopy():
with Image.open("Tests/images/g4_orientation_5.tif") as im:
out = copy.deepcopy(im)
assert out.size == (590, 88)
9 changes: 0 additions & 9 deletions Tests/test_numpy.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import warnings
from copy import deepcopy

import pytest

Expand Down Expand Up @@ -227,14 +226,6 @@ def test_load_first():
assert a.shape == (88, 590)


@skip_unless_feature("libtiff")
def test_load_first_deepcopy():
with Image.open("Tests/images/g4_orientation_5.tif") as im:
im_deepcopy = deepcopy(im)
a = numpy.array(im_deepcopy)
assert a.shape == (88, 590)


def test_bool():
# https://github.com/python-pillow/Pillow/issues/2044
a = numpy.zeros((10, 2), dtype=bool)
Expand Down

0 comments on commit dbfe2fb

Please sign in to comment.