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

[ENH] - Update tests with plots to not display / block #214

Merged
merged 2 commits into from
Aug 1, 2022

Conversation

TomDonoghue
Copy link
Contributor

Responds to #202

Currently when running the tests locally, a bunch of figures pop up, and some of them are blocking (wait for input / closing to proceed), which is pretty annoying. Digging into this a bit, most plots could be explicitly closed with plt.close, but this didn't work with the blocking plots, which would still wait for input. To address this, this sets pytest to run in "interactive mode" with the most salient outcome of this being that in this mode, creating plots defaults to block=False, such that blocking plots do not get created anymore. Tests also now proceed without displaying the other non-blocking plots.

Note: for me at least, this addresses all the plots except those in test_dynamictablesummary. On my laptop, these plots open in the browser, regardless of the interactive mode. I think this stems from some other issue / difference in how these plots are created. My quick-check guess is that this perhaps relates to DynamicTableSummaryWidget not defining a set_out_fig method (which other widgets seem to do), and which seems like it directs where to create the widget output, and without doing these get managed differently?

In terms of checking this change - I don't think anything should change on the automated tests, but it would be useful to check running tests locally, to double check this leads to consistent behaviour across systems.

@TomDonoghue TomDonoghue changed the title Update tests with plots to not display / block [ENH] - Update tests with plots to not display / block Jul 30, 2022
@bendichter bendichter merged commit fce12b9 into NeurodataWithoutBorders:master Aug 1, 2022
@TomDonoghue TomDonoghue deleted the pltstests branch August 1, 2022 17:34
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.

2 participants