Skip to content

Commit a12aee2

Browse files
committed
check stacklevel in userwarning too
1 parent 6e1a040 commit a12aee2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas/_testing/_warnings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ def _assert_caught_expected_warning(
130130
saw_warning = True
131131

132132
if check_stacklevel and issubclass(
133-
actual_warning.category, (FutureWarning, DeprecationWarning)
133+
actual_warning.category,
134+
(FutureWarning, DeprecationWarning, UserWarning),
134135
):
135136
_assert_raised_with_correct_stacklevel(actual_warning)
136137

0 commit comments

Comments
 (0)