Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved SPIDER test coverage #8668

Merged
merged 1 commit into from
Jan 8, 2025
Merged

Conversation

radarhere
Copy link
Member

At https://app.codecov.io/gh/python-pillow/Pillow/blob/main/Tests%2Ftest_file_spider.py, you can see that the last line of

def test_nonstack_dos() -> None:
with Image.open(TEST_FILE) as im:
for i, frame in enumerate(ImageSequence.Iterator(im)):
assert i <= 1, "Non-stack DOS file test failed"

is not covered.

It is testing

def seek(self, frame: int) -> None:
if self.istack == 0:
msg = "attempt to seek in a non-stack file"
raise EOFError(msg)

This PR changes the test to directly call seek(), so all test lines are run, and test coverage is improved.

@hugovk hugovk merged commit bd4fd58 into python-pillow:main Jan 8, 2025
49 checks passed
@radarhere radarhere deleted the spider_test branch January 8, 2025 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants