TST: coverage for skipped tests in io/formats/test_to_html.py
State: closed

- [ N/A] precursor to #22786
- [ ] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ N/A] whatsnew entry

There are currently 3 skipped tests in `io/formats/test_to_html.py`; `test_to_html_truncate`, `test_to_html_truncate_multi_index` and `test_to_html_truncate_multi_index_sparse_off`

Only `test_to_html_truncate` is required to provide regression coverage for #22786

However, it is probably appropriate for any changes to `test_to_html_truncate` to also be applied to the other two skipped tests within the scope of this PR.

cc @jreback 

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 @simonjayhawkins! Thanks for submitting the PR.

 - There are no PEP8 issues in the file [`pandas/tests/io/formats/test_to_html.py`](https://github.com/simonjayhawkins/pandas/blob/53c9607e279f30080c03795bdf883c887dabddb4/pandas/tests/io/formats/test_to_html.py) !


`test_to_html_truncate_multi_index_sparse_off` should fail! see #22887
changing:

https://github.com/pandas-dev/pandas/blob/e45a6c14fc969c31c46ae890e72883ffe6658b4e/pandas/io/formats/html.py#L235

to:

```python
sentinel = False
```
would pass all tests.
I have reduced the scope of the skipped tests to the truncation part and removed the `_repr_html_` path.

there are other tests that check that the style is applied.

can you rebase / tests are failng
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/22888?src=pr&el=h1) Report
> Merging [#22888](https://codecov.io/gh/pandas-dev/pandas/pull/22888?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/6bf6cd2fe991f4f57e045e1f28a9dff860b72b37?src=pr&el=desc) will **increase** coverage by `0.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #22888      +/-   ##
==========================================
+ Coverage   92.25%   92.27%   +0.01%     
==========================================
  Files         161      161              
  Lines       51186    51186              
==========================================
+ Hits        47222    47230       +8     
+ Misses       3964     3956       -8
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.65% <ø> (+0.01%)` | :arrow_up: |
| #single | `42.27% <ø> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/22888?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/formats/html.py](https://codecov.io/gh/pandas-dev/pandas/pull/22888/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvaHRtbC5weQ==) | `93.16% <0%> (+2.48%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/22888?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/22888?src=pr&el=footer). Last update [6bf6cd2...8d955ca](https://codecov.io/gh/pandas-dev/pandas/pull/22888?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

thanks!
xref #11060