Skip to content

Commit 7fd0131

Browse files
committed
ENH: add named based column css styling to pandas Styler (black fixup)
1 parent 7257c7d commit 7fd0131

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

pandas/tests/io/formats/test_style.py

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1692,26 +1692,21 @@ def test_no_cell_ids(self):
16921692
assert s.find('<td class="data row0 col0" >') != -1
16931693

16941694
def test_extending_table_styles(self):
1695-
df = pd.DataFrame(data=[[0, 1], [1, 2]], columns=['A', 'B'])
1696-
styler = df.style.set_table_styles([{
1697-
'selector': '',
1698-
'props': [('background-color', 'yellow')]}]
1699-
).extend_table_styles([{
1700-
'selector': '.col0',
1701-
'props': [('background-color', 'blue')]}]
1695+
df = pd.DataFrame(data=[[0, 1], [1, 2]], columns=["A", "B"])
1696+
styler = df.style.set_table_styles(
1697+
[{"selector": "", "props": [("background-color", "yellow")]}]
1698+
).extend_table_styles(
1699+
[{"selector": ".col0", "props": [("background-color", "blue")]}]
17021700
)
17031701
assert len(styler.table_styles) == 2
17041702

17051703
def test_column_styling(self):
1706-
df = pd.DataFrame(data=[[0, 1], [1, 2]], columns=['A', 'B'])
1707-
s = Styler(df, uuid='_')
1708-
s = s.extend_column_styles({
1709-
'A': [{
1710-
'selector': '',
1711-
'props': [('color', 'blue')]
1712-
}]
1713-
})
1714-
assert '#T__ .col0 {\n color: blue;\n }' in s.render()
1704+
df = pd.DataFrame(data=[[0, 1], [1, 2]], columns=["A", "B"])
1705+
s = Styler(df, uuid="_")
1706+
s = s.extend_column_styles(
1707+
{"A": [{"selector": "", "props": [("color", "blue")]}]}
1708+
)
1709+
assert "#T__ .col0 {\n color: blue;\n }" in s.render()
17151710

17161711

17171712
@td.skip_if_no_mpl

0 commit comments

Comments
 (0)