Fixturize tests/frame/test_axis_select_reindex.py
State: closed

Picking up #22471 again. Needed to readd some fixtures that were removed by #24885.


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

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25627?src=pr&el=h1) Report
> Merging [#25627](https://codecov.io/gh/pandas-dev/pandas/pull/25627?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/e28ae70ba8bd8b4174143543d1660421bc67887b?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

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

```diff
@@           Coverage Diff           @@
##           master   #25627   +/-   ##
=======================================
  Coverage   91.26%   91.26%           
=======================================
  Files         173      173           
  Lines       52968    52968           
=======================================
  Hits        48339    48339           
  Misses       4629     4629
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.83% <ø> (ø)` | :arrow_up: |
| #single | `41.71% <ø> (ø)` | :arrow_up: |


------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25627?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/25627?src=pr&el=footer). Last update [e28ae70...aa312da](https://codecov.io/gh/pandas-dev/pandas/pull/25627?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/25627?src=pr&el=h1) Report
> :exclamation: No coverage uploaded for pull request base (`master@87d7cdf`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff            @@
##             master   #25627   +/-   ##
=========================================
  Coverage          ?   91.83%           
=========================================
  Files             ?      174           
  Lines             ?    50643           
  Branches          ?        0           
=========================================
  Hits              ?    46510           
  Misses            ?     4133           
  Partials          ?        0
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.37% <ø> (?)` | |
| #single | `41.69% <ø> (?)` | |


------

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

i would like a more coherent strategy that just adding singleton fixtures, so better to show that a fixture is useful across multiple files first.
@jreback 
I get that #22236 and #22471 are a while back - your hard requirement was fixturization of all frame tests. All the existing fixtures already exists as "quasi-fixtures" in `tests.frame.common.TestData`, and #22471 is purely for translating.

The fact that they are attributes of `TestData` is enough of a reason to translate them to fixtures (which #22236 did, until @jbrockmendel deleted some that weren't used yet due to the "good first issue" losing its drive after a while).
@h-vetinari I think the approach here needs to change. Let's put fixtures *inside* the modules that use them. Once they are used by at least 2 but preferable more test modules, then we can pull them out. 

The problem is we have a hard time discovering cross modules what fixtures are useful an which are not. Since the code currently is not updated to use fixtures at all.
@jreback 
Can't do 3 things at the same time reasonably.

You're already requesting to do fixturization and renaming at the same time, let's keep the reorg for later. Also, case in point about the necessity of (some of) the fixtures re-added here: #25635
+1 on reorg of fixtures later
@jreback @WillAyd 
Thanks for all the reviews. This one seems to have slipped through the last round. ;-)
if you remove the datetime_series fixture and rebase would consider
@jreback 
This is updated and green. About the `datetime_series` fixture, please see [my comment](https://github.com/pandas-dev/pandas/pull/25627/files#r266751400) (that you had already agreed to), that these PRs should be translation *only*, and not rewrite tests: 
well, this would need a rebase and remove the added fixture; I am not sure I said to keep that fixtures, its pretty useless.
Thanks for taking care of this!
thanks @h-vetinari