MCPcopy
hub / github.com/pandas-dev/pandas / test_repr_html_long

Method test_repr_html_long

pandas/tests/io/formats/test_to_html.py:968–983  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

966 assert "..." in df._repr_html_()
967
968 def test_repr_html_long(self):
969 with option_context("display.max_rows", 60):
970 max_rows = get_option("display.max_rows")
971 h = max_rows - 1
972 df = DataFrame({"A": np.arange(1, 1 + h), "B": np.arange(41, 41 + h)})
973 reg_repr = df._repr_html_()
974 assert ".." not in reg_repr
975 assert str(41 + max_rows // 2) in reg_repr
976
977 h = max_rows + 1
978 df = DataFrame({"A": np.arange(1, 1 + h), "B": np.arange(41, 41 + h)})
979 long_repr = df._repr_html_()
980 assert ".." in long_repr
981 assert str(41 + max_rows // 2) not in long_repr
982 assert f"{h} rows " in long_repr
983 assert "2 columns" in long_repr
984
985 def test_repr_html_float(self):
986 with option_context("display.max_rows", 60):

Callers

nothing calls this directly

Calls 4

_repr_html_Method · 0.95
option_contextFunction · 0.90
get_optionFunction · 0.90
DataFrameClass · 0.90

Tested by

no test coverage detected