Skip to content

Commit d47bf11

Browse files
committed
Change assert_produces_warning behavior to check for all warnings by default
1 parent da262ca commit d47bf11

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/_testing/_warnings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def assert_produces_warning(
3333
check_stacklevel: bool = True,
3434
raise_on_extra_warnings: bool = True,
3535
match: str | tuple[str | None, ...] | None = None,
36-
must_find_all_warnings: bool = False,
36+
must_find_all_warnings: bool = True,
3737
) -> Generator[list[warnings.WarningMessage], None, None]:
3838
"""
3939
Context manager for running code expected to either raise a specific warning,
@@ -74,7 +74,7 @@ class for all warnings. To raise multiple types of exceptions,
7474
`expected_warning`. If additionally `must_find_all_warnings` is
7575
True, each expected warning's message gets matched with a respective
7676
match. Otherwise, multiple values get treated as an alternative.
77-
must_find_all_warnings : bool, default False
77+
must_find_all_warnings : bool, default True
7878
If True and `expected_warning` is a tuple, each expected warning
7979
type must get encountered. Otherwise, even one expected warning
8080
results in success.

0 commit comments

Comments
 (0)