MAINT: Clean up pandas/util/testing.py
State: closed

Transform testing methods to use more `pytest` idiom.

xref #15990.

Labels:
name: Testing
description: pandas testing functions or related to the test suite

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/16271?src=pr&el=h1) Report
> Merging [#16271](https://codecov.io/gh/pandas-dev/pandas/pull/16271?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/8809b04ffe55013b7e6fd2eab4156b6c3665c9fe?src=pr&el=desc) will **increase** coverage by `0.02%`.
> The diff coverage is `41.66%`.

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

```diff
@@            Coverage Diff             @@
##           master   #16271      +/-   ##
==========================================
+ Coverage   90.32%   90.34%   +0.02%     
==========================================
  Files         167      167              
  Lines       50908    50872      -36     
==========================================
- Hits        45981    45961      -20     
+ Misses       4927     4911      -16
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.13% <41.66%> (+0.04%)` | :arrow_up: |
| #single | `40.31% <8.33%> (-0.09%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/16271?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/16271?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `80.39% <41.66%> (+1.7%)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/16271?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/16271?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.59% <0%> (-0.1%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/16271?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/16271?src=pr&el=footer). Last update [8809b04...2c987d2](https://codecov.io/gh/pandas-dev/pandas/pull/16271?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/16271?src=pr&el=h1) Report
> Merging [#16271](https://codecov.io/gh/pandas-dev/pandas/pull/16271?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/ea56550ded81ff20e6ac77548958231a895264f3?src=pr&el=desc) will **increase** coverage by `0.02%`.
> The diff coverage is `41.66%`.

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

```diff
@@            Coverage Diff             @@
##           master   #16271      +/-   ##
==========================================
+ Coverage   90.34%   90.36%   +0.02%     
==========================================
  Files         167      167              
  Lines       50908    50872      -36     
==========================================
- Hits        45994    45973      -21     
+ Misses       4914     4899      -15
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.15% <41.66%> (+0.03%)` | :arrow_up: |
| #single | `40.31% <8.33%> (-0.09%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/16271?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/16271?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `80.39% <41.66%> (+1.51%)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/16271?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/16271?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.59% <0%> (-0.1%)` | :arrow_down: |
| [pandas/core/common.py](https://codecov.io/gh/pandas-dev/pandas/pull/16271?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY29tbW9uLnB5) | `91.03% <0%> (+0.34%)` | :arrow_up: |

------

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

@jreback : Not sure what `codecov` is complaining about.  However, I made all of the requested changes, and everything else is green.
@gfyoung yeah I am about ready to disable codecov. It is pretty bogus. I haven't been able to make it use the latest master as the comparison (not really sure why) and their help services are not very helpful :< 

if you want to have a look at other code coverage services we could easily switch.
thanks!