Skip to content

Commit 51be01f

Browse files
author
Chris Bertinato
committed
Added check for FutureWarning
1 parent 9148517 commit 51be01f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

pandas/tests/scalar/timedelta/test_timedelta.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
""" test the scalar Timedelta """
22
from datetime import timedelta
3-
from warnings import catch_warnings, simplefilter
43

54
import numpy as np
65
import pytest
@@ -290,10 +289,10 @@ def test_iso_conversion(self):
290289
assert to_timedelta('P0DT0H0M1S') == expected
291290

292291
def test_nat_converters(self):
293-
with catch_warnings():
294-
simplefilter("ignore", FutureWarning)
295-
292+
with tm.assert_produces_warning(FutureWarning):
296293
assert to_timedelta('nat', box=False).astype('int64') == iNaT
294+
295+
with tm.assert_produces_warning(FutureWarning):
297296
assert to_timedelta('nan', box=False).astype('int64') == iNaT
298297

299298
@pytest.mark.parametrize('units, np_unit',

0 commit comments

Comments
 (0)