-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TST/CLN: remove TestData from series-tests; replace with fixtures #22550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi! I am looking to start making open source contributions, tests seem like good place to start :) |
@Anjali2019, sounds great, but you should wait until #22526 has been merged, otherwise the fixtures in |
@h-vetinari Sure! makes sense. |
@Anjali2019 good to go. :) |
Awesome! Thanks. Will start on it :D |
* Replaced TestData usage in pandas/tests/series/test_quantile.py with datetime_series fixture
* Replaced TestData usage in pandas/tests/series/test_rank.py with fixture * Flattened test structure to function-based approach instead of class-based approach
* Replaced TestData usage in pandas/tests/series/test_rank.py with fixture * Flattened test structure to function-based approach instead of class-based approach
* Replaced TestData usage in pandas/tests/series/test_rank.py with fixture * Flattened test structure to function-based approach instead of class-based approach
I guess the next step then would be to remove the |
I created the follow-up issue to remove _common.py for series tests. This one here can be closed @simonjayhawkins ✌️ EDIT: I'll first need to remove TestData usage in |
This is the sister-issue for Series of #22471 (for frames), where the review in #22236 requested:
For Series, this process is started by #22526 by creating a
conftest.py
that translates all the current attributes ofTestData
to fixtures, with the following "translation guide":ts
->datetime_series
series
->string_series
objSeries
->object_series
empty
->empty_series
Need to incrementally replace their usages in
pandas/tests/series/
(example below).conftest.py
and translateTestData
-attributes into fixtures and renaming them them as outlined above (TST: fixturize series/test_alter_axes.py #22526)test_alter_axes.py
(TST: fixturize series/test_alter_axes.py #22526)test_analytics.py
(TST: Fixturize series/test_analytics.py #22755)test_api.py
(Remove TestData from series-tests test_api.py #29153)test_apply.py
(TST: Fixturize series/test_apply.py #22769)test_asof.py
(TST: Fixturize series/test_asof.py #22772)test_combine_concat.py
(TST: Fixturize series/test_combine_concat.py #22964)test_constructors.py
(TST: Fixturize series/test_constructors.py #22965)test_datetime_values.py
(TST: Fixturize series/test_datetime_values.py #22966)test_dtypes.py
(TST: Fixturize series/test_dtypes.py #22967)test_io.py
(TST: Fixturize series/test_io.py #22972)test_missing.py
(TST: Fixturize series/test_missing.py #22973)test_operators.py
([#22550] Remove TestData from series-tests test_operators.py #29084)test_quantile.py
([#22550] Remove TestData from series-tests test_quantile.py #29096)test_rank.py
([#22550] Remove TestData from series-tests test_rank.py #29101)test_replace.py
(Remove TestData from series-tests test_replace.py #29147)test_repr.py
(Remove TestData from series-tests test_repr.py #29148)test_sorting.py
(Remove TestData from series-tests test_sorting.py #29149)test_timeseries.py
(Remove TestData from series-tests test_timeseries.py #29150)test_validate.py
(TST: Fixturize series/test_validate.py #22756)Things for follow-ups:
An example from #22526 - before:
After:
Basically, it comes down to replacing all the occurrences of
self.<name>
withtranslation_guide[<name>]
(and specifying the latter as a parameter to the function).PS. Note that some fixtures added by #22526 have now been removed by #24885. Please check #24885 which code was removed, in case you should need it for the fixturisation. Alternatively, you can ping me, @jbrockmendel or @jreback.
The text was updated successfully, but these errors were encountered: