File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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" )
You can’t perform that action at this time.
0 commit comments