Skip to content

Commit 9267775

Browse files
author
Chris Bertinato
committed
Added check for FutureWarning
1 parent 7c52d63 commit 9267775

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
@@ -310,10 +309,10 @@ def test_iso_conversion(self):
310309
assert to_timedelta('P0DT0H0M1S') == expected
311310

312311
def test_nat_converters(self):
313-
with catch_warnings():
314-
simplefilter("ignore", FutureWarning)
315-
312+
with tm.assert_produces_warning(FutureWarning):
316313
assert to_timedelta('nat', box=False).astype('int64') == iNaT
314+
315+
with tm.assert_produces_warning(FutureWarning):
317316
assert to_timedelta('nan', box=False).astype('int64') == iNaT
318317

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

0 commit comments

Comments
 (0)