We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 607acbf commit 28e5b92Copy full SHA for 28e5b92
Tests/test_imagegrab.py
@@ -59,8 +59,10 @@ def test_grab_invalid_xdisplay(self) -> None:
59
60
@pytest.mark.skipif(sys.platform != "win32", reason="Windows only")
61
def test_grab_invalid_handle(self) -> None:
62
- with pytest.raises(OSError):
+ with pytest.raises(OSError, match="unable to get device context for handle"):
63
ImageGrab.grab(window=-1)
64
+ with pytest.raises(OSError, match="screen grab failed"):
65
+ ImageGrab.grab(window=0)
66
67
def test_grabclipboard(self) -> None:
68
if sys.platform == "darwin":
0 commit comments