STY: use pytest.raises context manager (frame)
State: closed

xref #24332

Labels:
name: Code Style
description: Code style, linting, code_checks

Comments:
looks fine. merge master and ping on green.
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25516?src=pr&el=h1) Report
> Merging [#25516](https://codecov.io/gh/pandas-dev/pandas/pull/25516?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/42b4c975e55c59da7868f99f9949841aca12a08d?src=pr&el=desc) will **decrease** coverage by `<.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #25516      +/-   ##
==========================================
- Coverage   91.75%   91.74%   -0.01%     
==========================================
  Files         173      173              
  Lines       52960    52956       -4     
==========================================
- Hits        48595    48587       -8     
- Misses       4365     4369       +4
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.32% <ø> (-0.01%)` | :arrow_down: |
| #single | `41.72% <ø> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/25516?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/sparse/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/25516/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc3BhcnNlL2ZyYW1lLnB5) | `94.84% <0%> (-0.86%)` | :arrow_down: |
| [pandas/io/formats/html.py](https://codecov.io/gh/pandas-dev/pandas/pull/25516/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvaHRtbC5weQ==) | `99.34% <0%> (-0.02%)` | :arrow_down: |
| [pandas/core/arrays/categorical.py](https://codecov.io/gh/pandas-dev/pandas/pull/25516/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2NhdGVnb3JpY2FsLnB5) | `95.97% <0%> (+0.01%)` | :arrow_up: |

------

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

# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25516?src=pr&el=h1) Report
> Merging [#25516](https://codecov.io/gh/pandas-dev/pandas/pull/25516?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/42b4c975e55c59da7868f99f9949841aca12a08d?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

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

```diff
@@           Coverage Diff           @@
##           master   #25516   +/-   ##
=======================================
  Coverage   91.75%   91.75%           
=======================================
  Files         173      173           
  Lines       52960    52960           
=======================================
  Hits        48595    48595           
  Misses       4365     4365
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.33% <ø> (ø)` | :arrow_up: |
| #single | `41.71% <ø> (ø)` | :arrow_up: |


------

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

@jreback: green!
thanks @simonjayhawkins