diff --git a/pandas/tests/io/formats/test_to_html.py b/pandas/tests/io/formats/test_to_html.py
index 845fb1ee3dc3a..035b2d4c3347c 100644
--- a/pandas/tests/io/formats/test_to_html.py
+++ b/pandas/tests/io/formats/test_to_html.py
@@ -1066,14 +1066,10 @@ def test_to_html_regression_GH6098(self):
df.pivot_table(index=[u('clé1')], columns=[u('clé2')])._repr_html_()
def test_to_html_truncate(self):
- pytest.skip("unreliable on travis")
index = pd.DatetimeIndex(start='20010101', freq='D', periods=20)
df = DataFrame(index=index, columns=range(20))
- fmt.set_option('display.max_rows', 8)
- fmt.set_option('display.max_columns', 4)
- result = df._repr_html_()
+ result = df.to_html(max_rows=8, max_cols=4)
expected = '''\
-
@@ -1159,23 +1155,15 @@ def test_to_html_truncate(self):
NaN |
-
-
20 rows × 20 columns
-
'''.format(div_style)
- if compat.PY2:
- expected = expected.decode('utf-8')
+'''
assert result == expected
def test_to_html_truncate_multi_index(self):
- pytest.skip("unreliable on travis")
arrays = [['bar', 'bar', 'baz', 'baz', 'foo', 'foo', 'qux', 'qux'],
['one', 'two', 'one', 'two', 'one', 'two', 'one', 'two']]
df = DataFrame(index=arrays, columns=arrays)
- fmt.set_option('display.max_rows', 7)
- fmt.set_option('display.max_columns', 7)
- result = df._repr_html_()
+ result = df.to_html(max_rows=7, max_cols=7)
expected = '''\
-
@@ -1276,24 +1264,16 @@ def test_to_html_truncate_multi_index(self):
NaN |
-
-
8 rows × 8 columns
-
'''.format(div_style)
- if compat.PY2:
- expected = expected.decode('utf-8')
+'''
assert result == expected
+ @pytest.mark.xfail(reason='GH22887 TypeError', strict=True)
def test_to_html_truncate_multi_index_sparse_off(self):
- pytest.skip("unreliable on travis")
arrays = [['bar', 'bar', 'baz', 'baz', 'foo', 'foo', 'qux', 'qux'],
['one', 'two', 'one', 'two', 'one', 'two', 'one', 'two']]
df = DataFrame(index=arrays, columns=arrays)
- fmt.set_option('display.max_rows', 7)
- fmt.set_option('display.max_columns', 7)
- fmt.set_option('display.multi_sparse', False)
- result = df._repr_html_()
+ result = df.to_html(max_rows=7, max_cols=7, sparsify=False)
expected = '''\
-
@@ -1387,11 +1367,7 @@ def test_to_html_truncate_multi_index_sparse_off(self):
NaN |
-
-
8 rows × 8 columns
-
'''.format(div_style)
- if compat.PY2:
- expected = expected.decode('utf-8')
+'''
assert result == expected
def test_to_html_border(self):