From b6d079564685909bcecc6b3e98340714ffdaac75 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Fri, 18 Jan 2019 18:37:55 -0500 Subject: [PATCH] Backport PR #13194: TST: Fix incorrect call to pytest.raises. --- 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 7cb5af621450..4c688eb05b15 100644 --- a/lib/matplotlib/tests/test_figure.py +++ b/lib/matplotlib/tests/test_figure.py @@ -365,8 +365,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")