Skip to content

Commit

Permalink
Added type hints to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Jun 22, 2024
1 parent ddec690 commit 95066b1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Tests/test_imagegrab.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def test_grabclipboard_file(self) -> None:
p.communicate()

im = ImageGrab.grabclipboard()
assert isinstance(im, list)
assert len(im) == 1
assert os.path.samefile(im[0], "Tests/images/hopper.gif")

Expand All @@ -105,6 +106,7 @@ def test_grabclipboard_png(self) -> None:
p.communicate()

im = ImageGrab.grabclipboard()
assert isinstance(im, Image.Image)
assert_image_equal_tofile(im, "Tests/images/hopper.png")

@pytest.mark.skipif(
Expand All @@ -120,6 +122,7 @@ def test_grabclipboard_wl_clipboard(self, ext: str) -> None:
with open(image_path, "rb") as fp:
subprocess.call(["wl-copy"], stdin=fp)
im = ImageGrab.grabclipboard()
assert isinstance(im, Image.Image)
assert_image_equal_tofile(im, image_path)

@pytest.mark.skipif(
Expand Down

0 comments on commit 95066b1

Please sign in to comment.