parametrize the first few arithmetic tests
State: closed

Start parametrizing arithmetic tests for DatetimeIndex and TimedeltaIndex, with an eye towards re-usability.

Labelling tests with the types of operands and the operations, e.g. "test_dti_add_int" for DatetimeIndex + integer.  This make it really easy to tell which combinations are and aren't implemented.

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

Comments:
Hello @jbrockmendel! Thanks for updating the PR.







Cheers ! There are no PEP8 issues in this Pull Request. :beers: 

##### Comment last updated on November 09, 2017 at 17:25 Hours UTC
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18133?src=pr&el=h1) Report
> Merging [#18133](https://codecov.io/gh/pandas-dev/pandas/pull/18133?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/1181622fbfc9208a906ae9e70716b83fc7b3ae5a?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/18133/graphs/tree.svg?height=150&width=650&token=eZ4WkYLtcO&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/18133?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #18133      +/-   ##
==========================================
- Coverage   91.28%   91.26%   -0.02%     
==========================================
  Files         163      163              
  Lines       50122    50127       +5     
==========================================
- Hits        45752    45749       -3     
- Misses       4370     4378       +8
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.07% <ø> (ø)` | :arrow_up: |
| #single | `40.32% <ø> (-0.06%)` | :arrow_down: |

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

------

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

```diff
@@            Coverage Diff             @@
##           master   #18133      +/-   ##
==========================================
- Coverage   91.42%    91.4%   -0.02%     
==========================================
  Files         163      163              
  Lines       50064    50064              
==========================================
- Hits        45772    45763       -9     
- Misses       4292     4301       +9
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.21% <ø> (ø)` | :arrow_up: |
| #single | `40.36% <ø> (-0.06%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/18133?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/18133?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/18133?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/18133?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/18133?src=pr&el=footer). Last update [17e0b13...8e4bfa5](https://codecov.io/gh/pandas-dev/pandas/pull/18133?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

After spending a little time with the docs/examples, I think pytest.fixture is going to stay outside my comfort zone for a while.
look at pandas/tests/reshape/test_merge.py for an example (or pandas/tests/io/tests_parquet.py for more sophisticated usage)
> look at pandas/tests/reshape/test_merge.py for an example

The fixtures there look like they each provide a single DataFrame.  We need separate tests for each timezone.  Something like:

```
@pytest.fixture
def tz():
    return [None, 'UTC', 'Asia/Tokyo', 'US/Eastern', 'dateutil/Asia/Singapore',
            'dateutil/US/Pacific']

class Whatever:
     def test_dti_add_timedeltalike(self, tz, delta):
```

would pass the whole `tz` fixture as the argument wouldn't it?
“””
@pytest.fixture(params=[None, 'UTC', 'Asia/Tokyo', 'US/Eastern', 'dateutil/Asia/Singapore',
            'dateutil/US/Pacific'])
def tz(request):
    return request.param
“””
Too much magic for me, can't implement that with a clear conscience.  We've got a good clean win here using pytest.parametrize in more places than before.
fixed up. pls always rebase when you push on anything. 
Travis error is looks like a DNS fail.  Kind of refreshing to not be a Clipboard thing.
i think all mac builds are borked atm
> i think all mac builds are borked atm

Yikes.  Just holler if I can do something useful; otherwise I'll stay out of the way.
thanks @jbrockmendel