From 2e5ab4002735396c4d9d50498e19fc3af967c63a Mon Sep 17 00:00:00 2001 From: gfyoung Date: Mon, 22 Apr 2019 23:35:30 -0700 Subject: [PATCH] TST: Remove bare pytest.raises in some test files --- pandas/tests/util/test_assert_produces_warning.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandas/tests/util/test_assert_produces_warning.py b/pandas/tests/util/test_assert_produces_warning.py index e125f01a494e7..79b2a56537613 100644 --- a/pandas/tests/util/test_assert_produces_warning.py +++ b/pandas/tests/util/test_assert_produces_warning.py @@ -12,8 +12,9 @@ def f(): @pytest.mark.filterwarnings('ignore:f1:FutureWarning') def test_assert_produces_warning_honors_filter(): - # raise by default - with pytest.raises(AssertionError): + # Raise by default. + msg = r"Caused unexpected warning\(s\)" + with pytest.raises(AssertionError, match=msg): with tm.assert_produces_warning(RuntimeWarning): f()