Conversation
|
Yeah, tests run in normal time with that disabled, so tests aren't taking longer, it just gets caught on the final one. |
|
The logic in this Explicitly adding However, it also resolved locally when I explicitly added I'm not sure which change exactly in 9.1.0 caused the fixture to no longer take effect, but it runs now 🤷🏻 |
|
Removed the pytest specs to avoid 9.1. Most of the diff is the formatter changing pyproject.toml |
|
Huh, updating testpaths fixed it locally, but not here. Seeing if adding autouse to the fixture also only works locally. |
|
Setting the fixture to autouse fixes it on runners and locally. However, I would like to know why the config changes we make in conftest don't seem to take effect, so I'll wait before merging this. |
| # License: Simplified BSD | ||
|
|
||
|
|
||
| import matplotlib.pyplot as plt |
There was a problem hiding this comment.
It's possible that doing this at the top sets the backend to non-Agg, which could be slower. I'd be surprised if it's 10x slower but 🤷
In MNE-Python we force set to Agg I think unless an env var is set to use Qt (which can be useful for debugging). I'd force-set here as well if that's not done already (haven't looked!)
| try: | ||
| want = os.environ["MNE_MPL_TESTING_BACKEND"] | ||
| except KeyError: | ||
| want = "agg" # don't pop up windows | ||
| with warnings.catch_warnings(record=True): # ignore warning | ||
| warnings.filterwarnings("ignore") | ||
| matplotlib.use(want, force=True) | ||
| import matplotlib.pyplot as plt |
There was a problem hiding this comment.
Oh nevermind this is already force-setting to agg
My shot in the dark is that in previous versions, having a session-scoped fixture might have caused it to be used even if it's not marked |
Okay I didn't read everything until just now... yeah this part seems weird. You could open a bug report about this change in behavior if you can isolate it properly. Can you make the corresponding |
Fixes #429
Locally, test suite runs with pytest 9.0.3 and 9.1.1 take the same time to run (Ubuntu 24.04, Python 3.13).
However, with pytest 9.1.1,
test_plot_connectivity_circle(the last test that gets run) has a plot pop-up which I have to close before the tests can finish, and which I didn't see for 9.0.3.There is a fixture that is supposed to prevent this from happening, but maybe something in 9.1.1 is preventing the fixture from working properly.
This is the only visualisation test that actually gets run, as the others are skipped due to lack of imageio-ffmpeg
Have disabled the test in question to see if that's indeed the culprit.