Skip to content

Commit 3e9068a

Browse files
committed
Decreased length of test image data
1 parent f99e0b8 commit 3e9068a

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

Tests/test_file_jpeg.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ def test_icc_after_SOF(self):
707707
assert im.info["icc_profile"] == b"profile"
708708

709709
def test_reading_not_whole_file_for_define_it_type(self):
710-
size = 1024 ** 2
710+
size = 4097
711711
buffer = BytesIO(b"\xFF" * size) # Many xFF bytes
712712
buffer.max_pos = 0
713713
orig_read = buffer.read
@@ -721,10 +721,8 @@ def read(n=-1):
721721
with pytest.raises(OSError):
722722
Image.open(buffer)
723723

724-
# Only small part of file has been read.
725-
# The upper limit of max_pos (8Kb) was chosen experimentally
726-
# and increased approximately twice.
727-
assert 0 < buffer.max_pos < 8 * 1024
724+
# Assert the entire file has not been read
725+
assert 0 < buffer.max_pos < size
728726

729727

730728
@pytest.mark.skipif(not is_win32(), reason="Windows only")

0 commit comments

Comments
 (0)