Skip to content

Commit

Permalink
Ignore some hard-to-manufacture error cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
freakboy3742 committed Oct 30, 2023
1 parent 62f3767 commit 90369b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion gtk/src/toga_gtk/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ def get_data(self):
success, buffer = self.native.save_to_bufferv("png")
if success:
return buffer
else:
else: # pragma: nocover
# This shouldn't ever happen, and it's difficult to manufacture in test conditions
raise ValueError("Unable to get PNG data for image")

def save(self, path):
Expand Down
3 changes: 2 additions & 1 deletion gtk/src/toga_gtk/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,5 +184,6 @@ def get_image_data(self):
success, buffer = screenshot.save_to_bufferv("png")
if success:
return buffer
else:
else: # pragma: nocover
# This shouldn't ever happen, and it's difficult to manufacture in test conditions
raise ValueError(f"Unable to generate screenshot of {self}")

0 comments on commit 90369b9

Please sign in to comment.