@@ -109,9 +109,8 @@ def test_getitem_get(datetime_series, string_series, object_series):
109
109
110
110
# None
111
111
# GH 5652
112
- with tm .assert_produces_warning (FutureWarning , check_stacklevel = False ):
113
- s1 = Series ()
114
- s2 = Series (index = list ("abc" ))
112
+ s1 = Series (dtype = object )
113
+ s2 = Series (dtype = object , index = list ("abc" ))
115
114
for s in [s1 , s2 ]:
116
115
result = s .get (None )
117
116
assert result is None
@@ -137,8 +136,7 @@ def test_getitem_generator(string_series):
137
136
138
137
def test_type_promotion ():
139
138
# GH12599
140
- with tm .assert_produces_warning (FutureWarning , check_stacklevel = False ):
141
- s = pd .Series ()
139
+ s = pd .Series (dtype = object )
142
140
s ["a" ] = pd .Timestamp ("2016-01-01" )
143
141
s ["b" ] = 3.0
144
142
s ["c" ] = "foo"
@@ -176,8 +174,7 @@ def test_getitem_out_of_bounds(datetime_series):
176
174
datetime_series [len (datetime_series )]
177
175
178
176
# GH #917
179
- with tm .assert_produces_warning (FutureWarning , check_stacklevel = False ):
180
- s = Series ([])
177
+ s = Series ([], dtype = object )
181
178
with pytest .raises (IndexError , match = msg ):
182
179
s [- 1 ]
183
180
@@ -334,14 +331,12 @@ def test_setitem(datetime_series, string_series):
334
331
335
332
# Test for issue #10193
336
333
key = pd .Timestamp ("2012-01-01" )
337
- with tm .assert_produces_warning (FutureWarning , check_stacklevel = False ):
338
- series = pd .Series ()
334
+ series = pd .Series (dtype = object )
339
335
series [key ] = 47
340
336
expected = pd .Series (47 , [key ])
341
337
tm .assert_series_equal (series , expected )
342
338
343
- with tm .assert_produces_warning (FutureWarning , check_stacklevel = False ):
344
- series = pd .Series ([], pd .DatetimeIndex ([], freq = "D" ))
339
+ series = pd .Series ([], pd .DatetimeIndex ([], freq = "D" ), dtype = object )
345
340
series [key ] = 47
346
341
expected = pd .Series (47 , pd .DatetimeIndex ([key ], freq = "D" ))
347
342
tm .assert_series_equal (series , expected )
@@ -649,8 +644,7 @@ def test_setitem_na():
649
644
650
645
def test_timedelta_assignment ():
651
646
# GH 8209
652
- with tm .assert_produces_warning (FutureWarning , check_stacklevel = False ):
653
- s = Series ([])
647
+ s = Series ([], dtype = object )
654
648
s .loc ["B" ] = timedelta (1 )
655
649
tm .assert_series_equal (s , Series (Timedelta ("1 days" ), index = ["B" ]))
656
650
0 commit comments