(self, html_encoding_file, flavor_read_html)
| 1410 | "from_encoding.*:UserWarning" |
| 1411 | ) |
| 1412 | def test_encode(self, html_encoding_file, flavor_read_html): |
| 1413 | base_path = os.path.basename(html_encoding_file) |
| 1414 | root = os.path.splitext(base_path)[0] |
| 1415 | _, encoding = root.split("_") |
| 1416 | |
| 1417 | try: |
| 1418 | with open(html_encoding_file, "rb") as fobj: |
| 1419 | from_string = flavor_read_html( |
| 1420 | BytesIO(fobj.read()), encoding=encoding, index_col=0 |
| 1421 | ).pop() |
| 1422 | |
| 1423 | with open(html_encoding_file, "rb") as fobj: |
| 1424 | from_file_like = flavor_read_html( |
| 1425 | BytesIO(fobj.read()), encoding=encoding, index_col=0 |
| 1426 | ).pop() |
| 1427 | |
| 1428 | from_filename = flavor_read_html( |
| 1429 | html_encoding_file, encoding=encoding, index_col=0 |
| 1430 | ).pop() |
| 1431 | tm.assert_frame_equal(from_string, from_file_like) |
| 1432 | tm.assert_frame_equal(from_string, from_filename) |
| 1433 | except Exception: |
| 1434 | # seems utf-16/32 fail on windows |
| 1435 | if is_platform_windows(): |
| 1436 | if "16" in encoding or "32" in encoding: |
| 1437 | pytest.skip() |
| 1438 | raise |
| 1439 | |
| 1440 | def test_parse_failure_unseekable(self, flavor_read_html): |
| 1441 | # Issue #17975 |
nothing calls this directly
no test coverage detected