Skip to content
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

attempt to replace nose with pytest #2217

Merged
merged 10 commits into from
Mar 3, 2020
Merged

attempt to replace nose with pytest #2217

merged 10 commits into from
Mar 3, 2020

Conversation

emmanuelle
Copy link
Contributor

No description provided.

@nicolaskruchten
Copy link
Contributor

💃

Maybe we need to remove nosetests from some requirements files also? probably not a blocker.

@emmanuelle
Copy link
Contributor Author

Apparently nose tools are used inside the test files:

$ grep -r "from nose" *
packages/python/chart-studio/chart_studio/tests/test_plot_ly/test_stream/test_stream.py~:from nose.plugins.attrib import attr
packages/python/chart-studio/chart_studio/tests/test_plot_ly/test_stream/test_stream.py~:from nose.tools import nottest
packages/python/chart-studio/chart_studio/tests/test_plot_ly/test_get_figure/test_get_figure.py:from nose.plugins.attrib import attr
packages/python/chart-studio/chart_studio/tests/test_plot_ly/test_get_requests/test_get_requests.py:from nose.plugins.attrib import attr
packages/python/chart-studio/chart_studio/tests/test_plot_ly/test_plotly/test_plot.py:from nose.plugins.attrib import attr
packages/python/chart-studio/chart_studio/tests/test_plot_ly/test_image/test_image.py:from nose.plugins.attrib import attr
packages/python/chart-studio/chart_studio/tests/test_plot_ly/test_meta/test_meta.py:from nose.plugins.attrib import attr
packages/python/chart-studio/chart_studio/tests/test_plot_ly/test_file/test_file.py:from nose.plugins.attrib import attr
packages/python/chart-studio/chart_studio/tests/test_plot_ly/test_grid/test_grid.py:from nose.plugins.attrib import attr
packages/python/chart-studio/chart_studio/tests/test_core/test_tools/test_get_embed.py:from nose.tools import raises
packages/python/chart-studio/chart_studio/tests/test_optional/test_matplotlylib/test_plot_mpl.py:from nose.plugins.attrib import attr
packages/python/chart-studio/chart_studio/tests/test_optional/test_matplotlylib/test_plot_mpl.py:from nose.tools import raises
packages/python/plotly/plotly/tests/test_core/test_figure_widget_backend/test_validate_no_frames.py:from nose.tools import raises
packages/python/plotly/plotly/tests/test_core/test_offline/test_offline.py:from nose.plugins.attrib import attr
packages/python/plotly/plotly/tests/test_core/test_figure_messages/test_move_delete_traces.py:from nose.tools import raises
packages/python/plotly/plotly/tests/test_core/test_figure_messages/test_on_change.py:from nose.tools import raises
packages/python/plotly/plotly/tests/test_core/test_colors/test_colors.py:from nose.tools import raises
packages/python/plotly/plotly/tests/test_core/test_graph_objs/test_annotations.py:from nose.tools import raises
packages/python/plotly/plotly/tests/test_core/test_graph_objs/test_append_trace.py:from nose.tools import raises
packages/python/plotly/plotly/tests/test_core/test_graph_objs/test_properties_validated.py~:from nose.tools import raises
packages/python/plotly/plotly/tests/test_core/test_graph_objs/test_properties_validated.py:from nose.tools import raises
packages/python/plotly/plotly/tests/test_core/test_graph_objs/test_constructor.py:from nose.tools import raises
packages/python/plotly/plotly/tests/test_core/test_graph_objs/test_template.py:from nose.tools import raises
packages/python/plotly/plotly/tests/test_core/test_graph_objs/test_frames.py:from nose.plugins.attrib import attr
packages/python/plotly/plotly/tests/test_core/test_graph_objs/test_layout_subplots.py:from nose.tools import raises
packages/python/plotly/plotly/tests/test_core/test_graph_objs/test_data.py:from nose.tools import raises
packages/python/plotly/plotly/tests/test_core/test_graph_objs/test_error_bars.py:from nose.tools import raises
packages/python/plotly/plotly/tests/test_core/test_graph_objs/test_figure_properties.py:from nose.tools import raises
packages/python/plotly/plotly/tests/test_core/test_graph_objs/test_scatter.py:from nose.tools import raises
packages/python/plotly/plotly/tests/test_optional/test_offline/test_offline.py:from nose.tools import raises
packages/python/plotly/plotly/tests/test_optional/test_offline/test_offline.py:from nose.plugins.attrib import attr
packages/python/plotly/plotly/tests/test_optional/test_utils/test_utils.py:from nose.plugins.attrib import attr
packages/python/plotly/plotly/tests/test_optional/test_matplotlylib/test_annotations.py:from nose.plugins.attrib import attr
packages/python/plotly/plotly/tests/test_optional/test_matplotlylib/test_axis_scales.py:from nose.plugins.attrib import attr
packages/python/plotly/plotly/tests/test_optional/test_matplotlylib/test_date_times.py:from nose.plugins.attrib import attr
packages/python/plotly/plotly/tests/test_optional/test_matplotlylib/test_bars.py:from nose.plugins.attrib import attr
packages/python/plotly/plotly/tests/test_optional/test_matplotlylib/test_subplots.py:from nose.plugins.attrib import attr
packages/python/plotly/plotly/tests/test_optional/test_matplotlylib/test_data.py:from nose.plugins.attrib import attr
packages/python/plotly/plotly/tests/test_optional/test_matplotlylib/test_lines.py:from nose.plugins.attrib import attr
packages/python/plotly/plotly/tests/test_optional/test_matplotlylib/test_scatter.py:from nose.plugins.attrib import attr
packages/python/plotly/plotly/matplotlylib/mplexporter/tests/test_basic.py:from nose.plugins.skip import SkipTest

so this one needs more work. I'd prefer getting rid of nose as a whole instead of just switching to running pytest but keeping to importing nose. It doesn't matter whether this PR is merged before of after the patch release.

@emmanuelle
Copy link
Contributor Author

Ha ha can't believe the CI was green on the first try! Happy reviewing... only 39 files :-p

@emmanuelle
Copy link
Contributor Author

I removed the "slow" attributes because we're not using them anywhere in the CI but this can be discussed of course. Sometimes it's good to remove unused code :-).

@emmanuelle
Copy link
Contributor Author

@nicolaskruchten you gave a 💃 but this was before I made a number of changes to remove completely the nose dependency, can you please confirm whether I can merge?

@nicolaskruchten
Copy link
Contributor

One last thing: we should remove references to nose from https://github.com/plotly/plotly.py/blob/master/contributing.md and any other non-code documentation please :)

After that, 💃

```

... or even more granular by running something like:

```bash
nosetests plotly/tests/test_plotly/test_plot.py
pytest plotly/tests/test_plotly/test_plot.py
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh can we add here the incantation for running a single test? I think it’s with a colon? I always forget it!

@emmanuelle emmanuelle merged commit 1e289c4 into master Mar 3, 2020
@emmanuelle emmanuelle deleted the nose-to-pytest branch March 27, 2020 16:28
@natsukium natsukium mentioned this pull request May 14, 2024
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants