def expected_html(datapath, name):
filename = '<STR_LIT:.>'.join([name, '<STR_LIT:html>'])<EOL>filepath = datapath('<STR_LIT>', '<STR_LIT>', '<STR_LIT:data>', '<STR_LIT:html>', filename)<EOL>with open(filepath, encoding='<STR_LIT:utf-8>') as f:<EOL><INDENT>html = f.read()<EOL><DEDENT>return html.rstrip()<EOL>
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.