Skip to content

Commit 4724634

Browse files
QuLogictimhoffm
authored andcommitted
TST: Fix incorrect call to pytest.raises. (#13194)
The `message` parameter is actually the message to print when it fails, but we want to check the exception message, which is the `match` parameter.
1 parent bb7bdfd commit 4724634

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/tests/test_figure.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,8 @@ def test_subplots_shareax_loglabels():
366366

367367
def test_savefig():
368368
fig = plt.figure()
369-
msg = "savefig() takes 2 positional arguments but 3 were given"
370-
with pytest.raises(TypeError, message=msg):
369+
msg = r"savefig\(\) takes 2 positional arguments but 3 were given"
370+
with pytest.raises(TypeError, match=msg):
371371
fig.savefig("fname1.png", "fname2.png")
372372

373373

0 commit comments

Comments
 (0)