CLN: Refactor pandas/tests/base - part3
State: closed

Part of #23877

- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`

-----------------------
Starting to dissolve the `Ops` Mixin to drive fixturization of `pandas/tests/base/`

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

Comments:
Thanks for your reviews!
I addressed all your comments @WillAyd @jschendel. Please have another look
@jreback Like mentioned in the issue description and in [this comment](https://github.com/pandas-dev/pandas/pull/30147#discussion_r355307827): The utils and fixtures in this PR will be used in more places than just `tests/base`. That's why I put the fixtures directly into the base conftest. Applying them right away would have yielded a huge PR, so I wanted to split it into parts.

I see now that not using the utils and fixtures anywhere makes it impossible to understand their purpose. I will update the PR and remove the usage of `Ops` in `tests/indexes` which needs much fewer changes than `tests/base`.
> @jreback Like mentioned in the issue description and in [this comment](https://github.com/pandas-dev/pandas/pull/30147#discussion_r355307827): The utils and fixtures in this PR will be used in more places than just `tests/base`. That's why I put the fixtures directly into the base conftest. Applying them right away would have yielded a huge PR, so I wanted to split it into parts.
> 
> I see now that not using the utils and fixtures anywhere makes it impossible to understand their purpose. I will update the PR and remove the usage of `Ops` in `tests/indexes` which needs much fewer changes than `tests/base`.

this is likely true, however, I would rather move them locally pandas/tests/base, THEN in a follow on conform names & patterns between multiple places in the codebase.

Makes sense. It makes the PRs more atomic
@jreback @WillAyd @jschendel 
Thanks for your feedback. I added the following changes to the PR:
1. I extended the scope of this PR and replaced the usage of the `Ops` mixin in `tests/indexes/` to provide some more context of the added fixtures and utils.
1. Like suggested, I moved the new fixtures into `tests/indexes/conftest.py` as that's the only place the fixtures are used for now
1. I'm using the existing `indeces_dict` from `tests/indexes/conftest.py` now instead of creating my own `indexes` fixtures now.

Please have another look at the PR
Some tests in `tests/indexes/test_base.py` break with the updated `indices` fixture. At least the `union` and `intersection` cases should be fixed I guess (they break with Index.union or Index.intersection is called from a tz-aware index on an array-like). If you agree I can create issues for it.

For this issue, I will just skip them.
@SaturnFromTitan is this still active?
Yes it is @jreback I'll continue after the holidays
@SaturnFromTitan looks like some merge conflicts - can you address?
Sorry for the abstinence. I'll pick this issue up this week.
@jreback Thanks to your comment about redundant tests I could reduce the scope of this PR quite a bit further. It's ready to review now.
Friendly reminder @jreback
thanks @SaturnFromTitan yeah love these test refactor PRs; we have built up some monotliths...though many are being taken down / split now, so thanks.