File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 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):
12171217 df = pd .DataFrame ({"a" : range (2 ), "b" : range (2 )})
12181218 df .to_hdf (path , "k1" )
12191219
1220- store = pd .HDFStore (path , "r" )
1220+ with pd .HDFStore (path , "r" ) as store :
12211221
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" )
12241224
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" )
12281228
12291229 def test_append_frame_column_oriented (self , setup_path ):
12301230 with ensure_clean_store (setup_path ) as store :
You can’t perform that action at this time.
0 commit comments