TST: Fix indexes test inheritance / fixturization
State: closed

Closes https://github.com/pandas-dev/pandas/issues/23746

Before:

```
7355 passed, 852 skipped, 5 xfailed, 13 warnings in 75.20 seconds
```

After:

```
5740 passed, 724 skipped, 5 xfailed, 12 warnings in 67.73 seconds 
```

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

Comments:
Hello @TomAugspurger! Thanks for submitting the PR.

 - There are no PEP8 issues in the file [`pandas/tests/indexes/common.py`](https://github.com/TomAugspurger/pandas/blob/7495d57ae969ffa8da5c679911db47f8919fabbc/pandas/tests/indexes/common.py) !

 - There are no PEP8 issues in the file [`pandas/tests/indexes/datetimelike.py`](https://github.com/TomAugspurger/pandas/blob/7495d57ae969ffa8da5c679911db47f8919fabbc/pandas/tests/indexes/datetimelike.py) !

 - There are no PEP8 issues in the file [`pandas/tests/indexes/test_base.py`](https://github.com/TomAugspurger/pandas/blob/7495d57ae969ffa8da5c679911db47f8919fabbc/pandas/tests/indexes/test_base.py) !

 - There are no PEP8 issues in the file [`pandas/tests/indexes/test_common.py`](https://github.com/TomAugspurger/pandas/blob/7495d57ae969ffa8da5c679911db47f8919fabbc/pandas/tests/indexes/test_common.py) !

 - There are no PEP8 issues in the file [`pandas/tests/indexes/test_numeric.py`](https://github.com/TomAugspurger/pandas/blob/7495d57ae969ffa8da5c679911db47f8919fabbc/pandas/tests/indexes/test_numeric.py) !

 - There are no PEP8 issues in the file [`pandas/tests/indexes/test_range.py`](https://github.com/TomAugspurger/pandas/blob/7495d57ae969ffa8da5c679911db47f8919fabbc/pandas/tests/indexes/test_range.py) !


# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/23825?src=pr&el=h1) Report
> Merging [#23825](https://codecov.io/gh/pandas-dev/pandas/pull/23825?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/99df7da9ef5b3b210f3045ee19279808368def28?src=pr&el=desc) will **decrease** coverage by `<.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #23825      +/-   ##
==========================================
- Coverage   92.29%   92.29%   -0.01%     
==========================================
  Files         161      161              
  Lines       51493    51490       -3     
==========================================
- Hits        47524    47521       -3     
  Misses       3969     3969
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.68% <ø> (-0.01%)` | :arrow_down: |
| #single | `42.32% <ø> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/23825?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/parsers.py](https://codecov.io/gh/pandas-dev/pandas/pull/23825/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3BhcnNlcnMucHk=) | `95.55% <0%> (-0.02%)` | :arrow_down: |
| [pandas/core/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/23825/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYmFzZS5weQ==) | `97.61% <0%> (ø)` | :arrow_up: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/23825/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.02% <0%> (ø)` | :arrow_up: |
| [pandas/core/arrays/sparse.py](https://codecov.io/gh/pandas-dev/pandas/pull/23825/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL3NwYXJzZS5weQ==) | `91.94% <0%> (ø)` | :arrow_up: |
| [pandas/core/indexes/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/23825/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9iYXNlLnB5) | `96.48% <0%> (ø)` | :arrow_up: |
| [pandas/core/series.py](https://codecov.io/gh/pandas-dev/pandas/pull/23825/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc2VyaWVzLnB5) | `93.68% <0%> (ø)` | :arrow_up: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/23825/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `86.09% <0%> (+0.05%)` | :arrow_up: |

------

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

> I think test_unique_na can be moved from common.py to test_base.py

done.

> Both test_has_duplicates and test_duplicated in common.py are still using the indices fixture.

hmm yes. As soon as I saw them using `self._holder`, I moved on from those tests. But those are indeed just skipping. I fixed this in aba63dae55c406a7bf5d2ce4dd36e206a03af9dc, if you could double check my work. I *think* that `type(indices)` is just fine for all these tests.

```
$ pytest pandas/tests/indexes/test_common.py -k test_duplicated -v
=================================================================== test session starts ====================================================================
platform darwin -- Python 3.7.0, pytest-3.10.0, py-1.6.0, pluggy-0.7.1 -- /Users/taugspurger/Envs/pandas-dev/bin/python3
cachedir: .pytest_cache
rootdir: /Users/taugspurger/sandbox/pandas, inifile: setup.cfg
plugins: xdist-1.23.2, repeat-0.7.0, forked-0.2, faulthandler-1.5.0, cov-2.6.0, hypothesis-3.59.1
collected 392 items / 350 deselected

pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[Index0-first] PASSED                                                                [  2%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[Index0-last] PASSED                                                                 [  4%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[Index0-False] PASSED                                                                [  7%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[Index1-first] PASSED                                                                [  9%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[Index1-last] PASSED                                                                 [ 11%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[Index1-False] PASSED                                                                [ 14%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[DatetimeIndex-first] PASSED                                                         [ 16%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[DatetimeIndex-last] PASSED                                                          [ 19%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[DatetimeIndex-False] PASSED                                                         [ 21%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[PeriodIndex-first] PASSED                                                           [ 23%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[PeriodIndex-last] PASSED                                                            [ 26%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[PeriodIndex-False] PASSED                                                           [ 28%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[TimedeltaIndex-first] PASSED                                                        [ 30%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[TimedeltaIndex-last] PASSED                                                         [ 33%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[TimedeltaIndex-False] PASSED                                                        [ 35%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[Int64Index0-first] PASSED                                                           [ 38%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[Int64Index0-last] PASSED                                                            [ 40%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[Int64Index0-False] PASSED                                                           [ 42%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[UInt64Index-first] PASSED                                                           [ 45%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[UInt64Index-last] PASSED                                                            [ 47%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[UInt64Index-False] PASSED                                                           [ 50%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[RangeIndex-first] SKIPPED                                                           [ 52%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[RangeIndex-last] SKIPPED                                                            [ 54%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[RangeIndex-False] SKIPPED                                                           [ 57%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[Float64Index-first] PASSED                                                          [ 59%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[Float64Index-last] PASSED                                                           [ 61%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[Float64Index-False] PASSED                                                          [ 64%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[Index2-first] PASSED                                                                [ 66%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[Index2-last] PASSED                                                                 [ 69%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[Index2-False] PASSED                                                                [ 71%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[CategoricalIndex-first] PASSED                                                      [ 73%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[CategoricalIndex-last] PASSED                                                       [ 76%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[CategoricalIndex-False] PASSED                                                      [ 78%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[Index3-first] SKIPPED                                                               [ 80%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[Index3-last] SKIPPED                                                                [ 83%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[Index3-False] SKIPPED                                                               [ 85%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[MultiIndex-first] SKIPPED                                                           [ 88%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[MultiIndex-last] SKIPPED                                                            [ 90%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[MultiIndex-False] SKIPPED                                                           [ 92%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[Int64Index1-first] PASSED                                                           [ 95%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[Int64Index1-last] PASSED                                                            [ 97%]
pandas/tests/indexes/test_common.py::TestCommon::test_duplicated[Int64Index1-False] PASSED                                                           [100%]

```


yeah this is ok. we need to finish moving to all fixtures from the inhertence setup of the original (might even be an open issue about this).
thanks