From 62e77320b9926080f267d05ea365343cf81903ca Mon Sep 17 00:00:00 2001 From: Daniel Schmidt Date: Mon, 31 Jan 2022 08:52:54 +0100 Subject: [PATCH] BUG 44011 - use dict as input for "set_table_styles" --- pandas/tests/io/formats/style/test_style.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pandas/tests/io/formats/style/test_style.py b/pandas/tests/io/formats/style/test_style.py index 915497e614b3a..88a0676cf3aec 100644 --- a/pandas/tests/io/formats/style/test_style.py +++ b/pandas/tests/io/formats/style/test_style.py @@ -839,12 +839,16 @@ def test_table_styles_multiple(self): def test_table_styles_dict_multiple_selectors(self): # GH 44011 result = self.df.style.set_table_styles( - [{"selector": "th,td", "props": [("border-left", "2px solid black")]}] + { + "B": [ + {"selector": "th,td", "props": [("border-left", "2px solid black")]} + ] + } )._translate(True, True)["table_styles"] expected = [ - {"selector": "th", "props": [("border-left", "2px solid black")]}, - {"selector": "td", "props": [("border-left", "2px solid black")]}, + {"selector": "th.col1", "props": [("border-left", "2px solid black")]}, + {"selector": "td.col1", "props": [("border-left", "2px solid black")]}, ] assert result == expected