@@ -278,11 +278,6 @@ def _print(result, error=None):
278
278
k2 = key2
279
279
_eq (t , o , a , obj , key1 , k2 )
280
280
281
- #GH14554: used to make sure recursion errors bubble up as expected
282
- recursive_df = pd .DataFrame ({'a' :[1 ,]}, index = ['a' ])
283
- def recursive_indexing_function (self , a ):
284
- return self .recursive_indexing_function (self .recursive_df .loc [['a' ], ['a' ]])
285
-
286
281
def test_indexer_caching (self ):
287
282
# GH5727
288
283
# make sure that indexers are in the _internal_names_set
@@ -1223,14 +1218,21 @@ def test_loc_getitem_bool(self):
1223
1218
fails = KeyError )
1224
1219
1225
1220
def test_recursion_fails_loc (self ):
1226
- #GH14554
1227
- #RuntimeError should bubble up if appropriate, rather
1228
- #than method specific exception
1221
+ # GH14554
1222
+ # RuntimeError should bubble up if appropriate, rather
1223
+ # than method specific exception
1224
+
1225
+ recursive_df = pd .DataFrame ({'a' : [1 ,]}, index = ['a' ])
1226
+
1227
+ def recursive_indexing_function (self , a ):
1228
+ return recursive_indexing_function (
1229
+ recursive_df [['a' ], ['a' ]])
1230
+
1229
1231
oldVal = sys .getrecursionlimit ()
1230
1232
sys .setrecursionlimit (50 )
1231
1233
with self .assertRaises (RuntimeError ):
1232
1234
try :
1233
- self . recursive_indexing_function (1 )
1235
+ recursive_indexing_function (self , 1 )
1234
1236
finally :
1235
1237
sys .setrecursionlimit (oldVal )
1236
1238
0 commit comments