@@ -74,8 +74,10 @@ def test_apply_mixed_datetimelike(self):
7474 result = df .apply (lambda x : x , axis = 1 )
7575 assert_frame_equal (result , df )
7676
77- def test_apply_empty (self , float_frame , empty_frame ):
77+ def test_apply_empty (self , float_frame ):
7878 # empty
79+ empty_frame = DataFrame ()
80+
7981 applied = empty_frame .apply (np .sqrt )
8082 assert applied .empty
8183
@@ -97,8 +99,10 @@ def test_apply_empty(self, float_frame, empty_frame):
9799 result = expected .apply (lambda x : x ['a' ], axis = 1 )
98100 assert_frame_equal (expected , result )
99101
100- def test_apply_with_reduce_empty (self , empty_frame ):
102+ def test_apply_with_reduce_empty (self ):
101103 # reduce with an empty DataFrame
104+ empty_frame = DataFrame ()
105+
102106 x = []
103107 result = empty_frame .apply (x .append , axis = 1 , result_type = 'expand' )
104108 assert_frame_equal (result , empty_frame )
@@ -116,7 +120,9 @@ def test_apply_with_reduce_empty(self, empty_frame):
116120 # Ensure that x.append hasn't been called
117121 assert x == []
118122
119- def test_apply_deprecate_reduce (self , empty_frame ):
123+ def test_apply_deprecate_reduce (self ):
124+ empty_frame = DataFrame ()
125+
120126 x = []
121127 with tm .assert_produces_warning (FutureWarning ):
122128 empty_frame .apply (x .append , axis = 1 , reduce = True )
0 commit comments