Skip to content

Commit 3c3bafa

Browse files
Add test for depr behavior
1 parent ff88b30 commit 3c3bafa

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

pandas/tests/tools/test_to_timedelta.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,23 @@ def test_to_timedelta_invalid(self):
121121
invalid_data, to_timedelta(invalid_data, errors="ignore")
122122
)
123123

124+
@pytest.mark.parametrize(
125+
"val",
126+
[
127+
"1M",
128+
"1 M",
129+
"1Y",
130+
"1 Y",
131+
"1m",
132+
"1 m",
133+
"1y",
134+
"1 y",
135+
],
136+
)
137+
def test_unambiguous_timedelta_values(self, val):
138+
with tm.assert_produces_warning(FutureWarning):
139+
to_timedelta(val)
140+
124141
def test_to_timedelta_via_apply(self):
125142
# GH 5458
126143
expected = Series([np.timedelta64(1, "s")])

0 commit comments

Comments
 (0)