From 28e5b929f8dcae3312f45e8aeb8d3b03b290036d Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Tue, 5 Nov 2024 08:40:09 +1100 Subject: [PATCH] Test 0 --- Tests/test_imagegrab.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Tests/test_imagegrab.py b/Tests/test_imagegrab.py index 032dac8ccec..35aaa7ff0b6 100644 --- a/Tests/test_imagegrab.py +++ b/Tests/test_imagegrab.py @@ -59,8 +59,10 @@ def test_grab_invalid_xdisplay(self) -> None: @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":