parametrize more tests, move to test_liboffstes
State: closed

Some tests currently in test_offsets belong in test_liboffsets, this moves them.

There is a test_shift_month in test_offsets and another in test_liboffsets.  This combines them.

Continuing the process of making the big lists of tests in test_offsets use pytest.mark.parametrize.  Is there any downside to doing this?  e.g. when it collects the tests, will it hold them all in memory (instead of as a generator)?

- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`

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

Comments:
> Continuing the process of making the big lists of tests in test_offsets use pytest.mark.parametrize. Is there any downside to doing this? e.g. when it collects the tests, will it hold them all in memory (instead of as a generator)?

no

the point is usuability, you can run very specific tests, and see exactly what fails, while exercising lots of cases.

these are silghtly more abstruse than a loop, but the above point wins.
in some cases you *might* want to use ``ids`` (with a callable) to actually name the tests more intelligently. This is sometimes nicer.
I didn't think so, but it was worth asking.  At one point with dateutil I tried testing every combination of several parameters and RAM usage spiked during pytest test collection, had to kill the process.  This was a loop that would have been harmless (albeit poorly advised for other reasons) using older nose-yield-style tests.  Let me a little gunshy.
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18346?src=pr&el=h1) Report
> Merging [#18346](https://codecov.io/gh/pandas-dev/pandas/pull/18346?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/cfad581e9a6d35c7d05d2b1f34e4a19f7ee15cc6?src=pr&el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #18346      +/-   ##
==========================================
- Coverage   91.38%   91.36%   -0.02%     
==========================================
  Files         164      164              
  Lines       49790    49790              
==========================================
- Hits        45501    45492       -9     
- Misses       4289     4298       +9
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.17% <ø> (ø)` | :arrow_up: |
| #single | `39.53% <ø> (-0.03%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/18346?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/18346?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/18346?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.8% <0%> (-0.1%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18346?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/18346?src=pr&el=footer). Last update [cfad581...90e4c80](https://codecov.io/gh/pandas-dev/pandas/pull/18346?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/18346?src=pr&el=h1) Report
> Merging [#18346](https://codecov.io/gh/pandas-dev/pandas/pull/18346?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/cfad581e9a6d35c7d05d2b1f34e4a19f7ee15cc6?src=pr&el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #18346      +/-   ##
==========================================
- Coverage   91.38%   91.36%   -0.02%     
==========================================
  Files         164      164              
  Lines       49790    49790              
==========================================
- Hits        45501    45492       -9     
- Misses       4289     4298       +9
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.17% <ø> (ø)` | :arrow_up: |
| #single | `39.53% <ø> (-0.03%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/18346?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/18346?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/18346?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.8% <0%> (-0.1%)` | :arrow_down: |

------

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

thanks!