From a913e26f6230de6ffb97f1b32ea0f92911a3c105 Mon Sep 17 00:00:00 2001 From: vangorade Date: Fri, 1 Jan 2021 19:02:52 +0000 Subject: [PATCH 1/2] TST: add missing loc label indexing test --- pandas/tests/indexing/test_loc.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pandas/tests/indexing/test_loc.py b/pandas/tests/indexing/test_loc.py index 89315b16937b1..17c9104686107 100644 --- a/pandas/tests/indexing/test_loc.py +++ b/pandas/tests/indexing/test_loc.py @@ -56,9 +56,11 @@ def test_loc_getitem_label_out_of_range(self): self.check_result("loc", 20, typs=["floats"], axes=0, fails=KeyError) def test_loc_getitem_label_list(self): - # TODO: test something here? # list of labels - pass + self.check_result("loc", [0, 1, 2], typs=[ + "ints", "uints", "floats"], fails=KeyError) + self.check_result("loc", [1, 3.0, 'A'], typs=[ + "ints", "uints", "floats"], fails=KeyError) def test_loc_getitem_label_list_with_missing(self): self.check_result("loc", [0, 1, 2], typs=["empty"], fails=KeyError) From f941c09ab249252bfb6378c67084f31a07f5b29c Mon Sep 17 00:00:00 2001 From: vangorade Date: Sat, 2 Jan 2021 18:23:35 +0530 Subject: [PATCH 2/2] formated file using black --- pandas/tests/indexing/test_loc.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pandas/tests/indexing/test_loc.py b/pandas/tests/indexing/test_loc.py index 17c9104686107..6c5cd0f335faa 100644 --- a/pandas/tests/indexing/test_loc.py +++ b/pandas/tests/indexing/test_loc.py @@ -57,10 +57,12 @@ def test_loc_getitem_label_out_of_range(self): def test_loc_getitem_label_list(self): # list of labels - self.check_result("loc", [0, 1, 2], typs=[ - "ints", "uints", "floats"], fails=KeyError) - self.check_result("loc", [1, 3.0, 'A'], typs=[ - "ints", "uints", "floats"], fails=KeyError) + self.check_result( + "loc", [0, 1, 2], typs=["ints", "uints", "floats"], fails=KeyError + ) + self.check_result( + "loc", [1, 3.0, "A"], typs=["ints", "uints", "floats"], fails=KeyError + ) def test_loc_getitem_label_list_with_missing(self): self.check_result("loc", [0, 1, 2], typs=["empty"], fails=KeyError)