Skip to content

Commit 4f0cc40

Browse files
committed
Use pytest.raises match argument
1 parent 2ecf88e commit 4f0cc40

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Tests/test_imagegrab.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ def test_grabclipboard(self):
6565
p.communicate()
6666
else:
6767
if not shutil.which("wl-paste"):
68-
with pytest.raises(NotImplementedError) as e:
68+
with pytest.raises(
69+
NotImplementedError,
70+
match="wl-paste or xclip is required for"
71+
" ImageGrab.grabclipboard\(\) on Linux",
72+
):
6973
ImageGrab.grabclipboard()
70-
assert (
71-
str(e.value) == "wl-paste or xclip is required"
72-
" for ImageGrab.grabclipboard() on Linux"
73-
)
7474
return
7575

7676
ImageGrab.grabclipboard()

0 commit comments

Comments
 (0)