This commit is contained in:
Andrew Murray 2024-11-05 08:40:09 +11:00
parent 607acbf95e
commit 28e5b929f8

View File

@ -59,8 +59,10 @@ class TestImageGrab:
@pytest.mark.skipif(sys.platform != "win32", reason="Windows only")
def test_grab_invalid_handle(self) -> None:
with pytest.raises(OSError):
with pytest.raises(OSError, match="unable to get device context for handle"):
ImageGrab.grab(window=-1)
with pytest.raises(OSError, match="screen grab failed"):
ImageGrab.grab(window=0)
def test_grabclipboard(self) -> None:
if sys.platform == "darwin":