Converted windows / 32bit skips into decorators
State: closed

- [X] xref #18190 
- [ ] tests added / passed
- [X] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

Don't have a 32bit or Windows platform at my disposal so plan to leverage AppVeyor and compare before / after of skips to ensure consistency. If you have other ideas on how to tackle let me know.

FWIW the functions that were previously defined in ``pandas.util.testing`` were scarcely used, but I noticed that a lot of tests manually checked for 32 bit or windows and skipped directly. For consistency, I've updated those to use the decorators as well (will need to go back and do the same thing for matplotlib)

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

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18693?src=pr&el=h1) Report
> Merging [#18693](https://codecov.io/gh/pandas-dev/pandas/pull/18693?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/288bf6e5e3287a8c66a7ed41050db0ebf56d7ea6?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff             @@
##           master   #18693      +/-   ##
==========================================
+ Coverage    91.6%    91.6%   +<.01%     
==========================================
  Files         153      153              
  Lines       51272    51261      -11     
==========================================
- Hits        46967    46957      -10     
+ Misses       4305     4304       -1
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.46% <100%> (+0.01%)` | :arrow_up: |
| #single | `40.69% <100%> (-0.1%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/18693?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/18693/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `82.53% <ø> (+0.7%)` | :arrow_up: |
| [pandas/util/\_test\_decorators.py](https://codecov.io/gh/pandas-dev/pandas/pull/18693/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvX3Rlc3RfZGVjb3JhdG9ycy5weQ==) | `94.11% <100%> (+0.78%)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/18693/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/18693/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.81% <0%> (-0.1%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18693?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/18693?src=pr&el=footer). Last update [288bf6e...86fd4d6](https://codecov.io/gh/pandas-dev/pandas/pull/18693?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/18693?src=pr&el=h1) Report
> Merging [#18693](https://codecov.io/gh/pandas-dev/pandas/pull/18693?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/2db1cc098d939b7d7b41e18ad8525d18ad20c1ad?src=pr&el=desc) will **increase** coverage by `0.01%`.
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff             @@
##           master   #18693      +/-   ##
==========================================
+ Coverage   91.58%    91.6%   +0.01%     
==========================================
  Files         153      153              
  Lines       51307    51262      -45     
==========================================
- Hits        46991    46958      -33     
+ Misses       4316     4304      -12
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.46% <100%> (+0.03%)` | :arrow_up: |
| #single | `40.69% <100%> (-0.14%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/18693?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/18693/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `82.53% <ø> (+0.51%)` | :arrow_up: |
| [pandas/util/\_test\_decorators.py](https://codecov.io/gh/pandas-dev/pandas/pull/18693/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvX3Rlc3RfZGVjb3JhdG9ycy5weQ==) | `94.11% <100%> (+0.78%)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/18693/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/io/json/table\_schema.py](https://codecov.io/gh/pandas-dev/pandas/pull/18693/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2pzb24vdGFibGVfc2NoZW1hLnB5) | `95.83% <0%> (-1.39%)` | :arrow_down: |
| [pandas/io/json/json.py](https://codecov.io/gh/pandas-dev/pandas/pull/18693/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2pzb24vanNvbi5weQ==) | `91.75% <0%> (-0.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/18693/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.81% <0%> (-0.1%)` | :arrow_down: |
| [pandas/plotting/\_core.py](https://codecov.io/gh/pandas-dev/pandas/pull/18693/diff?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb3JlLnB5) | `82.37% <0%> (-0.04%)` | :arrow_down: |
| [pandas/io/pytables.py](https://codecov.io/gh/pandas-dev/pandas/pull/18693/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3B5dGFibGVzLnB5) | `92.84% <0%> (-0.01%)` | :arrow_down: |
| [pandas/core/indexes/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/18693/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9kYXRldGltZXMucHk=) | `95.68% <0%> (ø)` | :arrow_up: |
| [pandas/core/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/18693/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ2VuZXJpYy5weQ==) | `95.9% <0%> (ø)` | :arrow_up: |
| ... and [2 more](https://codecov.io/gh/pandas-dev/pandas/pull/18693/diff?src=pr&el=tree-more) | |

------

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

Made a mistake on my last commit applying the class decorator in ``test_coercion`` - I realized now that those conditions were only applied to certain dtypes. 

Going to parameterize that class to make it more readable and integrate better with the decorator. Stay tuned...
As mentioned before I refactored the ``TestReplaceSeriesCoercion`` class in ``test_coercion`` to use ``pytest.mark.parametrize``. Although I couldn't use the skip decorators in that fashion, it is still should be an improvement in readability over what was there before.

If my math is right, then comparing to upstream/master this should:

**Python 3 Windows**
- Add 154 passing tests
  - ``test_coercion``
    - -1 for removing ``test_has_comprehensive_tests``
    - +144 for ``to_key`` ``from_key`` and ``how`` parameters in ``test_replace_series`` EXCEPT
    - +9 when ``from_key`` is bool, because the ``series`` tests get skipped
    - +2 for ``test_frame`` and ``test_store_mixed`` being parametrized in ``test_pytables``
- Skip 22 more tests
  - ``test_coercion``
    - +5 parametrization now has 6 total tests to skip for down casting, instead of just one before
    - +8 more skips for parametrization of ``from_key`` of ``bool`` and ``how`` of ``series``
    - +8 when ``from_key`` is bool, because the ``series`` tests get skipped


**Python 2 Windows**
  - The -9 skips when ``from_key`` is bool, because the ``series`` move into passing tests
  - +2 skips for ``test_frame`` and ``test_store_mixed`` being parametrized ``test_pytables``
Some linting, you can use ``make lint-diff`` locally

```
$ ci/lint.sh
inside ci/lint.sh
Linting *.py
pandas/tests/io/test_pytables.py:27:1: F401 'pandas.compat.PY3' imported but unused
pandas/tests/util/test_testing.py:13:1: F401 'pandas.compat.is_platform_windows' imported but unused
Linting *.py DONE
```
a test failure on windows 3.6: https://ci.appveyor.com/project/pandas-dev/pandas/build/1.0.7841/job/2it8g3yxrmgg9mdl

I believe this was skipped before (on windows / python 3). its a float64 conversion to complex128.
otherwise changes lgtm. ping on green.
Yep thanks for the callout. I also have to make some changes to ``test_coercion`` because using the ``td.skip_if`` functions in an imperative manner does not actually skip the tests. I'm exploring some Pytest options right now but may end up backing out changes to that module and leaving that to a separate change to be parametrized, assuming that there's no way obvious way to decorate the combinations of dtypes that are currently being skipped
I ended up checking out ``test_coercion.py`` from upstream/master because I couldn't figure out a great way to refactor it using the skip_if decorators. The classes there can still be parametrized, but I opened up #18706 to cover that rather than doing it here, since that would assumedly be done without decorators

With this last push, I'd expect 2 more passing tests in Python 2 and 2 more skipped tests in Python 3 due to the parametrization of ``test_frame`` and ``test_store_mixed`` in ``test_pytables.py``
ok lgtm ping on green

thanks for making that issue
nice to have parameter ization there
@jreback is there any option to increase the verbosity on the AppVeyor test runs? The number of tests being executed is still slightly off of my expectation. I have the feeling that two tests have somehow been lost
sure in your PR add -v to the pytest line in appveyor.yml
can revert the commit before merging 
also i believe u can login to appveyor under your own account and you’re builds will run there as well (and so will be faster)
can you rebase and push again
Just rebased and re-pushed. FWIW I checked a verbose log in AppVeyor and all of the tests changed matched my expectation and were skipped accordingly. I still am not getting 100% the numbers I was expecting but I don't think any differences there are a result of this change
nice! keep em coming!
I took off the closing of #18190,  we can just make checkboxes I think. can you prepare a list (and I'll update the top of the issue).
You should be able to copy the checklist that's in my comment at the bottom of #18190. I just updated it to reflect the change here