Skip to content

Commit d74901b

Browse files
gfyoungjreback
authored andcommitted
TST: Remove bare pytest.raises in some test files (pandas-dev#26193)
1 parent 3de4a85 commit d74901b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pandas/tests/util/test_assert_produces_warning.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ def f():
1212

1313
@pytest.mark.filterwarnings('ignore:f1:FutureWarning')
1414
def test_assert_produces_warning_honors_filter():
15-
# raise by default
16-
with pytest.raises(AssertionError):
15+
# Raise by default.
16+
msg = r"Caused unexpected warning\(s\)"
17+
with pytest.raises(AssertionError, match=msg):
1718
with tm.assert_produces_warning(RuntimeWarning):
1819
f()
1920

0 commit comments

Comments
 (0)