File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -1217,14 +1217,14 @@ def test_read_missing_key_opened_store(self, setup_path):
1217
1217
df = pd .DataFrame ({"a" : range (2 ), "b" : range (2 )})
1218
1218
df .to_hdf (path , "k1" )
1219
1219
1220
- store = pd .HDFStore (path , "r" )
1220
+ with pd .HDFStore (path , "r" ) as store :
1221
1221
1222
- with pytest .raises (KeyError , match = "'No object named k2 in the file'" ):
1223
- pd .read_hdf (store , "k2" )
1222
+ with pytest .raises (KeyError , match = "'No object named k2 in the file'" ):
1223
+ pd .read_hdf (store , "k2" )
1224
1224
1225
- # Test that the file is still open after a KeyError and that we can
1226
- # still read from it.
1227
- pd .read_hdf (store , "k1" )
1225
+ # Test that the file is still open after a KeyError and that we can
1226
+ # still read from it.
1227
+ pd .read_hdf (store , "k1" )
1228
1228
1229
1229
def test_append_frame_column_oriented (self , setup_path ):
1230
1230
with ensure_clean_store (setup_path ) as store :
You can’t perform that action at this time.
0 commit comments