From 78ab43f057b7dea3df83e9cd13f7ef06b5631121 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Wed, 16 Jan 2019 07:25:26 -0500 Subject: [PATCH] TST: Fix incorrect call to pytest.raises. 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. --- lib/matplotlib/tests/test_figure.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/tests/test_figure.py b/lib/matplotlib/tests/test_figure.py index ddcdb0bc3cb6..8a13b4741887 100644 --- a/lib/matplotlib/tests/test_figure.py +++ b/lib/matplotlib/tests/test_figure.py @@ -366,8 +366,8 @@ def test_subplots_shareax_loglabels(): def test_savefig(): fig = plt.figure() - msg = "savefig() takes 2 positional arguments but 3 were given" - with pytest.raises(TypeError, message=msg): + msg = r"savefig\(\) takes 2 positional arguments but 3 were given" + with pytest.raises(TypeError, match=msg): fig.savefig("fname1.png", "fname2.png")