TST: Timedelta tests reorg (gh14854)
State: closed

 - [x] Partially completes #14854 
 - [x] Tests reorganized
 - [x] passes ``git diff upstream/master | flake8 --diff``
 - [x] whatsnew: reorg of Timedelta tests



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

Comments:
@TrigonaMinima looks great!

just a couple of corrections.
pls add a whatsnew note as well (reorg of timeseries tests), you can put in other API changes section (in 0.20.0)
only thing left after this are the timeseries_legacy.py tests I think (but let's deal with them in a separate PR).
I haven't finished the reorg of ```Period``` tests yet. Should I do it in this PR only?

@TrigonaMinima no, let's leave period for another.
@jreback I tried by best, but there were still some confusions. So, could you please have somewhat deeper look at it. I'll correct the issues if there are any, tomorrow night.

what confusions?
- Some coercion functions from ```tseries/test_tslib.py``` I moved to ```indexing/test_coercion.py```.
- ```_conversion``` and ```_format_converters``` functions (currently in ```scalar/test_timedelta.py```) to be sent to ```scalar/test_timedelta``` or ```indexes/timedeltas```?
- ```test_timedelta_ops_scalar``` (currently in ```indexes/timedeltas/test_ops.py```) in scalar/test_timedelta.py or ```indexes/timedeltas```? Here I was confused because there were some arithmetic operations going on between Timedelta and Timestamp but it said scalar.
- This function - ```test_add_overflow``` was under class ```TestSlicing``` (currently in ```tests/test_ops.py```). Why was that? I almost placed it in ```test_partial_slicing.py```.
Also, I want to understand the code of the core pandas library. Any suggestions on what should the starting point be?
ok i will have a look and see if anything needs moving

so best way to understand code is to:

debug or write a test, then step thru and see what it does

starting with a Series or DataFrame method is useful to see
@TrigonaMinima some flake errors.

I'll have a look at your points above when merging.
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/15324?src=pr&el=h1) Report
> Merging [#15324](https://codecov.io/gh/pandas-dev/pandas/pull/15324?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/8d574508d458072cc85488d1b432a8fa8813545a?src=pr&el=desc) will **increase** coverage by `<.01%`.


```diff
@@            Coverage Diff             @@
##           master   #15324      +/-   ##
==========================================
+ Coverage   86.32%   86.33%   +<.01%     
==========================================
  Files         141      141              
  Lines       51164    51164              
==========================================
+ Hits        44169    44170       +1     
+ Misses       6995     6994       -1
```


| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/15324?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/common.py](https://codecov.io/gh/pandas-dev/pandas/compare/8d574508d458072cc85488d1b432a8fa8813545a...08dad9a564f32dbab48771ecf8f9aa164709df71?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY29tbW9uLnB5) | `91.36% <ø> (+0.33%)` | :white_check_mark: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/15324?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/15324?src=pr&el=footer). Last update [8d57450...b24b95d](https://codecov.io/gh/pandas-dev/pandas/compare/8d574508d458072cc85488d1b432a8fa8813545a...b24b95d659e966e73efa9eacc2b0436f37647763?el=footer&src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
@jreback don't know what to do with this build/merge error.

I have fixed the merge conflicts. I am able to merge this branch to master without any conflicts on my local repo.
ok np i'll fix this up
https://github.com/pandas-dev/pandas/compare/master...jreback:TrigonaMinima-gh14854-timedelta?expand=1

is the compare, with a couple of changes from on top.

@TrigonaMinima really appreciate the PRs here! segregated tests that are not in huge files are awesome!
@TrigonaMinima thanks again for this!

love for you to keep going (period tests!)

keep in mind we are switching to ``pytest`` very shortly (its should work similarly though).