@@ -170,39 +170,6 @@ def test_unsupported_depth(backend: str) -> None:
170170 sct .grab (sct .monitors [1 ])
171171
172172
173- def test_region_out_of_monitor_bounds (display : str , backend : str ) -> None :
174- monitor = {"left" : - 30 , "top" : 0 , "width" : WIDTH , "height" : HEIGHT }
175-
176- with mss .mss (display = display , backend = backend , with_cursor = True ) as sct :
177- # At one point, I had accidentally been reporting the resource ID as a CData object instead of the contained
178- # int. This is to make sure I don't repeat that mistake. That said, change this error regex if needed to keep
179- # up with formatting changes.
180- expected_err_re = (
181- r"(?is)"
182- r"Error of failed request:\s+(8|BadMatch)\b"
183- r".*Major opcode of failed request:\s+73\b"
184- r".*Resource id in failed request:\s+[0-9]"
185- r".*Serial number of failed request:\s+[0-9]"
186- )
187-
188- with pytest .raises (ScreenShotError , match = expected_err_re ) as exc :
189- sct .grab (monitor )
190-
191- details = exc .value .details
192- assert details
193- assert isinstance (details , dict )
194- if backend in {"xgetimage" , "xshmgetimage" } and mss .linux .xcb .LIB .errors is None :
195- pytest .xfail ("Error strings in XCB backends are only available with the xcb-util-errors library." )
196- assert isinstance (details ["error" ], str )
197-
198- errstr = str (exc .value )
199- assert "Match" in errstr # Xlib: "BadMatch"; XCB: "Match"
200- assert "GetImage" in errstr # Xlib: "X_GetImage"; XCB: "GetImage"
201-
202- if backend == "xlib" :
203- assert not mss .linux .xlib ._ERROR
204-
205-
206173def test__is_extension_enabled_unknown_name (display : str ) -> None :
207174 with mss .mss (display = display , backend = "xlib" ) as sct :
208175 assert isinstance (sct , mss .linux .xlib .MSS ) # For Mypy
0 commit comments