@@ -682,10 +682,9 @@ def test_frame_select_complex2(tmp_path):
682
682
683
683
# scope with list like
684
684
l0 = selection .index .tolist () # noqa:F841
685
- store = HDFStore (hh )
686
- result = store .select ("df" , where = "l1=l0" )
687
- tm .assert_frame_equal (result , expected )
688
- store .close ()
685
+ with HDFStore (hh ) as store :
686
+ result = store .select ("df" , where = "l1=l0" )
687
+ tm .assert_frame_equal (result , expected )
689
688
690
689
result = read_hdf (hh , "df" , where = "l1=l0" )
691
690
tm .assert_frame_equal (result , expected )
@@ -705,21 +704,18 @@ def test_frame_select_complex2(tmp_path):
705
704
tm .assert_frame_equal (result , expected )
706
705
707
706
# scope with index
708
- store = HDFStore (hh )
709
-
710
- result = store .select ("df" , where = "l1=index" )
711
- tm .assert_frame_equal (result , expected )
712
-
713
- result = store .select ("df" , where = "l1=selection.index" )
714
- tm .assert_frame_equal (result , expected )
707
+ with HDFStore (hh ) as store :
708
+ result = store .select ("df" , where = "l1=index" )
709
+ tm .assert_frame_equal (result , expected )
715
710
716
- result = store .select ("df" , where = "l1=selection.index.tolist() " )
717
- tm .assert_frame_equal (result , expected )
711
+ result = store .select ("df" , where = "l1=selection.index" )
712
+ tm .assert_frame_equal (result , expected )
718
713
719
- result = store .select ("df" , where = "l1=list( selection.index)" )
720
- tm .assert_frame_equal (result , expected )
714
+ result = store .select ("df" , where = "l1=selection.index.tolist( )" )
715
+ tm .assert_frame_equal (result , expected )
721
716
722
- store .close ()
717
+ result = store .select ("df" , where = "l1=list(selection.index)" )
718
+ tm .assert_frame_equal (result , expected )
723
719
724
720
725
721
def test_invalid_filtering (setup_path ):
0 commit comments