TST/CLN: Fixturize frame/test_analytics by h-vetinari · Pull Request #22733 · pandas-dev/pandas (original) (raw)

This module is much harder to fixturize than e.g. #22236 or #22730, mainly due to the class methods _check_stat_op and _check_bool_op, which, despite having an argument for the frame they're testing, are also testing on other quasi-fixtures of TestData. Since I can't import directly from frame/conftest without getting RemovedInPytest4Warnings, I made theses fixtures explicit arguments of the respective methods.

Furthermore, I extracted two fixtures that basically correspond to those methods being called without a frame argument, and added them to conftest.

The larger question is how to avoid all these redundant calls being made (e.g. in test_max), and how _check_stat_op / _check_stat_op should be properly split up into several tests/parametrizations. So I don't view this PR as ready, but needing discussion regarding how to best proceed.