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

Method test_to_html_compat

pandas/tests/io/test_html.py:145–158  ·  view source on GitHub ↗
(self, flavor_read_html)

Source from the content-addressed store, hash-verified

143 return datapath("io", "data", "html", "banklist.html")
144
145 def test_to_html_compat(self, flavor_read_html):
146 df = (
147 DataFrame(
148 np.random.default_rng(2).random((4, 3)),
149 columns=pd.Index(list("abc")),
150 )
151 .map("{:.3f}".format)
152 .astype(float)
153 )
154 out = df.to_html()
155 res = flavor_read_html(
156 StringIO(out), attrs={"class": "dataframe"}, index_col=0
157 )[0]
158 tm.assert_frame_equal(res, df)
159
160 def test_dtype_backend(self, string_storage, dtype_backend, flavor_read_html):
161 # GH#50286

Callers

nothing calls this directly

Calls 5

DataFrameClass · 0.90
flavor_read_htmlFunction · 0.85
astypeMethod · 0.45
mapMethod · 0.45
to_htmlMethod · 0.45

Tested by

no test coverage detected