TST: Remove compat.PY2 and compat.PY3 flags from tests
State: closed

- [X] xref #25725
- [X] tests added / passed
- [X] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`

These flags become trivial after dropping Python 2.  There are still some Python 2 specific things that can be removed from the tests but this should eliminate a lot of the low hanging fruit.

Can split this up into separate PRs if need be; there are lots of changes but they're of low complexity and disjoint from each other, so shouldn't be too bad to review.  Can wait on the other PRs mentioned in the master tracker issue if we want those to go in first.

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

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25817?src=pr&el=h1) Report
> Merging [#25817](https://codecov.io/gh/pandas-dev/pandas/pull/25817?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/cdfdd77b65df350386ce27142ef3babd9e5186d2?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/25817/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/25817?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #25817      +/-   ##
==========================================
+ Coverage   91.27%   91.27%   +<.01%     
==========================================
  Files         173      173              
  Lines       53002    53002              
==========================================
+ Hits        48375    48376       +1     
+ Misses       4627     4626       -1
```

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

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

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25817?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/25817?src=pr&el=footer). Last update [cdfdd77...4fa5aa2](https://codecov.io/gh/pandas-dev/pandas/pull/25817?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/25817?src=pr&el=h1) Report
> Merging [#25817](https://codecov.io/gh/pandas-dev/pandas/pull/25817?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/cdfdd77b65df350386ce27142ef3babd9e5186d2?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/25817/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/25817?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master   #25817   +/-   ##
=======================================
  Coverage   91.27%   91.27%           
=======================================
  Files         173      173           
  Lines       53002    53002           
=======================================
  Hits        48375    48375           
  Misses       4627     4627
```

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


------

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

thanks @jschendel 

that's what I like, -1000 lines!
keep em coming!