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

Function expected_html

pandas/tests/io/formats/test_to_html.py:32–51  ·  view source on GitHub ↗

Read HTML file from formats data directory. Parameters ---------- datapath : pytest fixture The datapath fixture injected into a test by pytest. name : str The name of the HTML file without the suffix. Returns ------- str : contents of HTML file.

(datapath, name)

Source from the content-addressed store, hash-verified

30
31
32def expected_html(datapath, name):
33 """
34 Read HTML file from formats data directory.
35
36 Parameters
37 ----------
38 datapath : pytest fixture
39 The datapath fixture injected into a test by pytest.
40 name : str
41 The name of the HTML file without the suffix.
42
43 Returns
44 -------
45 str : contents of HTML file.
46 """
47 filename = ".".join([name, "html"])
48 filepath = datapath("io", "formats", "data", "html", filename)
49 with open(filepath, encoding="utf-8") as f:
50 html = f.read()
51 return html.rstrip()
52
53
54@pytest.fixture(params=["mixed", "empty"])

Calls 4

datapathFunction · 0.85
rstripMethod · 0.80
joinMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected