mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-03-23 19:44:13 +03:00
Use pytest.raises match argument
This commit is contained in:
parent
2ecf88eaa6
commit
73a2c3049f
|
@ -65,12 +65,12 @@ $bmp = New-Object Drawing.Bitmap 200, 200
|
||||||
p.communicate()
|
p.communicate()
|
||||||
else:
|
else:
|
||||||
if not shutil.which("wl-paste"):
|
if not shutil.which("wl-paste"):
|
||||||
with pytest.raises(NotImplementedError) as e:
|
with pytest.raises(
|
||||||
|
NotImplementedError,
|
||||||
|
match="wl-paste or xclip is required for"
|
||||||
|
r" ImageGrab.grabclipboard\(\) on Linux",
|
||||||
|
):
|
||||||
ImageGrab.grabclipboard()
|
ImageGrab.grabclipboard()
|
||||||
assert (
|
|
||||||
str(e.value) == "wl-paste or xclip is required"
|
|
||||||
" for ImageGrab.grabclipboard() on Linux"
|
|
||||||
)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
ImageGrab.grabclipboard()
|
ImageGrab.grabclipboard()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user