Skip to content

Commit

Permalink
Use pytest.raises match argument
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Dec 28, 2022
1 parent 2ecf88e commit 4f0cc40
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Tests/test_imagegrab.py
Expand Up @@ -65,12 +65,12 @@ def test_grabclipboard(self):
p.communicate()
else:
if not shutil.which("wl-paste"):
with pytest.raises(NotImplementedError) as e:
with pytest.raises(
NotImplementedError,
match="wl-paste or xclip is required for"
" ImageGrab.grabclipboard\(\) on Linux",
):
ImageGrab.grabclipboard()
assert (
str(e.value) == "wl-paste or xclip is required"
" for ImageGrab.grabclipboard() on Linux"
)
return

ImageGrab.grabclipboard()
Expand Down

0 comments on commit 4f0cc40

Please sign in to comment.