Skip to content

Commit 0ccedc2

Browse files
committed
ENH: test to ensure tooltip class ignored if set_tooltips not called.
1 parent b077157 commit 0ccedc2

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

pandas/tests/io/formats/test_style.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1702,15 +1702,23 @@ def test_tooltip_render(self):
17021702
assert "#T__ .pd-t {" in s.render()
17031703
# test 'min' tooltip added
17041704
assert (
1705-
'#T__ #T__row0_col0:hover .pd-t {\n visibility: visible;\n } #T__ #T__row0_col0 .pd-t::after {\n content: "Min";\n }'
1705+
"#T__ #T__row0_col0:hover .pd-t {\n visibility: visible;\n } "
1706+
+ '#T__ #T__row0_col0 .pd-t::after {\n content: "Min";\n }'
17061707
in s.render()
17071708
)
17081709
# test 'max' tooltip added
17091710
assert (
1710-
'#T__ #T__row1_col1:hover .pd-t {\n visibility: visible;\n } #T__ #T__row1_col1 .pd-t::after {\n content: "Max";\n }'
1711+
"#T__ #T__row1_col1:hover .pd-t {\n visibility: visible;\n } "
1712+
+ '#T__ #T__row1_col1 .pd-t::after {\n content: "Max";\n }'
17111713
in s.render()
17121714
)
17131715

1716+
def test_tooltip_ignored(self):
1717+
# GH XXXXX
1718+
df = pd.DataFrame(data=[[0, 1], [2, 3]])
1719+
s = Styler(df, uuid="_") # no set_tooltips()
1720+
assert '<style type="text/css" >\n</style>' in s.render()
1721+
17141722

17151723
@td.skip_if_no_mpl
17161724
class TestStylerMatplotlibDep:

0 commit comments

Comments
 (0)