-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
TST/CLN: remove TestData from frame-tests; replace with fixtures #22471
Labels
Milestone
Comments
gfyoung
added
Testing
pandas testing functions or related to the test suite
Clean
labels
Aug 25, 2018
This was referenced Aug 25, 2018
@h-vetinari : Seems reasonable to me. Done. |
This was referenced Sep 17, 2018
Hi! I am a beginner to open source. Can I take up this issue? |
2 tasks
@akulagrawal : Go for it! |
This was referenced Oct 1, 2018
This was referenced Jan 22, 2019
This was referenced Mar 10, 2019
Seems like the following files don't contain TestData (anymore) and can be checked or removed from the issue description:
I'll take a look at the others |
This was referenced Oct 22, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Following review in #22236:
Started the process in that PR by creating a
conftest.py
that translates all the current attributes ofTestData
to fixtures, with the following "translation guide":frame
->float_frame
frame2
->float_frame2
intframe
->int_frame
tsframe
->datetime_frame
mixed_frame
->float_string_frame
mixed_float
->mixed_float_frame
mixed_float2
->mixed_float_frame2
mixed_int
->mixed_int_frame
all_mixed
->mixed_type_frame
tzframe
->timezone_frame
empty
->empty_frame
ts1
->datetime_series
ts2
->datetime_series_short
simple
->simple_frame
Need to incrementally replace their usages in
pandas/tests/frame/
(example below).conftest.py
and translateTestData
-attributes into fixtures (TST/CLN: break up & parametrize tests for df.set_index #22236)test_alter_axes.py
(TST/CLN: break up & parametrize tests for df.set_index #22236)test_analytics.py
(TST/CLN: Fixturize frame/test_analytics #22733)test_api.py
(Fixturize tests/frame/test_api and tests/sparse/frame/test_frame #22738)test_apply.py
(Fixturize tests/frame/test_apply #22735)test_arithmetic.py
(Fixturize tests/frame/test_arithmetic #22736)test_asof.py
(Fixturize tests/frame/test_asof.py #25628)test_axis_select_reindex.py
(Fixturize tests/frame/test_axis_select_reindex.py #25627)test_block_internals.py
(TST/CLN: Fixturize tests/frame/test_block_internals.py #22926)test_combine_concat.py
(Fixturize tests/frame/test_combine_concat.py #25634)test_constructors.py
(Fixturize tests/frame/test_constructors.py #25635)test_convert_to.py
test_dtypes.py
(Fixturize tests/frame/test_dtypes.py #25636)test_duplicates.py
test_indexing.py
(Fixturize tests/frame/test_indexing.py #25633)test_join.py
(Fixturize tests/frame/test_join.py #25639)test_missing.py
(TST: Fixturize tests/frame/test_missing.py #25640)test_mutate_columns.py
(Fixturize tests/frame/test_mutate_columns.py #25642)test_nonunique_indexes.py
test_operators.py
(Fixturize tests/frame/test_operators.py #25641)test_period.py
test_quantile.py
test_query_eval.py
test_rank.py
test_replace.py
test_repr_info.py
test_reshape.py
test_sort_values_level_as_str.py
test_sorting.py
test_subclass.py
test_timeseries.py
test_timezones.py
test_to_csv.py
test_validate.py
Things for follow-ups:
An example from #22236 - before:
After:
Basically, it comes down to replacing all the occurrences of
self.<name>
withtranslation_guide[<name>]
(and specifying<name>
as a parameter to the function).PS. Note that some fixtures added by #22236 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: