REF/TST: Add more pytest idiom to util/test_util
State: closed

Also breaks up `test_util` into multiple test modules by the function or method tested.

Labels:
name: Refactor
description: Internal refactoring of code
name: Testing
description: pandas testing functions or related to the test suite

Comments:
Hello @gfyoung! Thanks for submitting the PR.

 - There are no PEP8 issues in the file [`pandas/tests/util/test_deprecate_kwarg.py`](https://github.com/gfyoung/pandas/blob/d24df8a87e6d571998a64d7730286fbfc06261d7/pandas/tests/util/test_deprecate_kwarg.py) !

 - There are no PEP8 issues in the file [`pandas/tests/util/test_locale.py`](https://github.com/gfyoung/pandas/blob/d24df8a87e6d571998a64d7730286fbfc06261d7/pandas/tests/util/test_locale.py) !

 - There are no PEP8 issues in the file [`pandas/tests/util/test_move.py`](https://github.com/gfyoung/pandas/blob/d24df8a87e6d571998a64d7730286fbfc06261d7/pandas/tests/util/test_move.py) !

 - There are no PEP8 issues in the file [`pandas/tests/util/test_safe_import.py`](https://github.com/gfyoung/pandas/blob/d24df8a87e6d571998a64d7730286fbfc06261d7/pandas/tests/util/test_safe_import.py) !

 - There are no PEP8 issues in the file [`pandas/tests/util/test_util.py`](https://github.com/gfyoung/pandas/blob/d24df8a87e6d571998a64d7730286fbfc06261d7/pandas/tests/util/test_util.py) !

 - There are no PEP8 issues in the file [`pandas/tests/util/test_validate_args.py`](https://github.com/gfyoung/pandas/blob/d24df8a87e6d571998a64d7730286fbfc06261d7/pandas/tests/util/test_validate_args.py) !

 - There are no PEP8 issues in the file [`pandas/tests/util/test_validate_args_and_kwargs.py`](https://github.com/gfyoung/pandas/blob/d24df8a87e6d571998a64d7730286fbfc06261d7/pandas/tests/util/test_validate_args_and_kwargs.py) !

 - There are no PEP8 issues in the file [`pandas/tests/util/test_validate_kwargs.py`](https://github.com/gfyoung/pandas/blob/d24df8a87e6d571998a64d7730286fbfc06261d7/pandas/tests/util/test_validate_kwargs.py) !


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

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

```diff
@@            Coverage Diff             @@
##           master   #24141      +/-   ##
==========================================
+ Coverage    92.2%    92.2%   +<.01%     
==========================================
  Files         162      162              
  Lines       51700    51700              
==========================================
+ Hits        47670    47671       +1     
+ Misses       4030     4029       -1
```

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

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/24141?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/24141/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `87.41% <0%> (-0.1%)` | :arrow_down: |
| [pandas/io/json/json.py](https://codecov.io/gh/pandas-dev/pandas/pull/24141/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2pzb24vanNvbi5weQ==) | `93.09% <0%> (+0.47%)` | :arrow_up: |

------

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

thanks @gfyoung