Clean / Consolidate pandas/tests/io/test_html.py
State: closed

This is an **extremely** aggressive change to get all of the test cases unified between the LXML and BS4 parsers. On the plus side both parsers can share the same set of tests and functionality, but on the downside it gives lxml a little more power than it had previously, where it would quickly fall back to bs4 for malformed sites. 

Review / criticism appreciated

Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: IO HTML
description: read_html, to_html, Styler.apply, Styler.applymap

Comments:
Hello @WillAyd! Thanks for updating the PR.







Cheers ! There are no PEP8 issues in this Pull Request. :beers: 

##### Comment last updated on March 13, 2018 at 23:39 Hours UTC
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/20293?src=pr&el=h1) Report
> :exclamation: No coverage uploaded for pull request base (`master@3783ccc`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
> The diff coverage is `81.81%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/20293/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/20293?src=pr&el=tree)

```diff
@@            Coverage Diff            @@
##             master   #20293   +/-   ##
=========================================
  Coverage          ?   91.74%           
=========================================
  Files             ?      150           
  Lines             ?    49154           
  Branches          ?        0           
=========================================
  Hits              ?    45097           
  Misses            ?     4057           
  Partials          ?        0
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.13% <81.81%> (?)` | |
| #single | `41.9% <13.63%> (?)` | |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/20293?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/compat/\_\_init\_\_.py](https://codecov.io/gh/pandas-dev/pandas/pull/20293/diff?src=pr&el=tree#diff-cGFuZGFzL2NvbXBhdC9fX2luaXRfXy5weQ==) | `57.74% <66.66%> (ø)` | |
| [pandas/io/html.py](https://codecov.io/gh/pandas-dev/pandas/pull/20293/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2h0bWwucHk=) | `88.79% <84.21%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/20293?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/20293?src=pr&el=footer). Last update [3783ccc...50d072d](https://codecov.io/gh/pandas-dev/pandas/pull/20293?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

Missed your question before but the way this worked is that I combined all of the lxml and bs4 test classes into one, deleting tests where duplicated and also moving in some of the top level tests that weren't being tested for both (ex: `test_importcheck_thread_safety`)

The following were deleted:
-  `test_data_fail` as the changes to the lxml parser to make it more robust didn't trigger this failure
- ` test_bs4_finds_tables`as it wasn't something that could be shared, and also wasn't testing the parser
- `test_lxml_finds_tables` similar reason as above
CircleCI failure was a timeout - don't believe it's related to this change
thanks

note I saw a single skip on my local

```
pandas/tests/io/test_html.py::TestReadHtml::test_parse_failure_unseekable[lxml] SKIPPED                                                                                                                                            [ 93%]
```
```
SKIP [1] /Users/jreback/pandas/pandas/tests/io/test_html.py:842: Not applicable for lxml
```

Yep there was one test that was testing the failure message when trying to read an unseekable IO object twice. lxml actually didn't have any problem reading it twice, so I placed an imperative skip for that parser in the test