Skip to content

Commit 3d65a64

Browse files
committed
add test to count number of warnings emitted
1 parent 7d06940 commit 3d65a64

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pandas/tests/io/parser/test_parse_dates.py

+8
Original file line numberDiff line numberDiff line change
@@ -1685,6 +1685,14 @@ def test_parse_delimited_date_swap_with_warning(
16851685
tm.assert_frame_equal(result, expected)
16861686

16871687

1688+
def test_parse_multiple_delimited_dates_with_swap_warnings():
1689+
# GH46210
1690+
warning_msg = "Specify a format to ensure consistent parsing"
1691+
with tm.assert_produces_warning(UserWarning, match=warning_msg) as record:
1692+
pd.to_datetime(["01/01/2000", "31/05/2000", "31/05/2001", "01/02/2000"])
1693+
assert len(record) == 1
1694+
1695+
16881696
def _helper_hypothesis_delimited_date(call, date_string, **kwargs):
16891697
msg, result = None, None
16901698
try:

0 commit comments

Comments
 (0)