Closed DragaDoncila closed 2 months ago
Hmm looks like a real failure - will take a look and ping for reviews after I fix it
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 92.39%. Comparing base (
ef84d01
) to head (bca7429
). Report is 6 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I can confirm this fixes the issue I was having, documented in the zulip thread.
The errors we're seeing are only occurring on npe2 0.7.2 and 0.7.3, but not the latest two releases. The tests fail consistently when run in the terminal, but I can't get any of them to fail when debugging, to figure out exactly what's happening. I'm going to bump the npe2 min req to 0.7.4 :woman_shrugging: Worth noting too this is an error in the cleanup of the DynamicPlugin
used for testing, so I really don't think it's worth the time to track it down exactly.
Clutching at straws, do you think https://github.com/napari/npe2/pull/325 could be related? (nevermind, it was added in 0.7.3, but tests fail 0.7.2 as well)
It would be nice to follow up with an update to the app-model docs, to say that _mock_app
is not autouse: https://napari.org/dev/developers/architecture/app_model.html#mock-app
@lucyleeow good point have opened docs/#403 to address
References and relevant issues
See zulip thread for discussion.
Description
Prior to this PR, running tests with the
make_napari_viewer
fixture outside of napari was failing due to shared instances of theNapariApplication
. In internal tests, weautouse
the_mock_app
fixture, so each test had its own new instance.To make sure
make_napari_viewer
behaves the same in our internal tests as it does externally, this PR moves the_mock_app
fixture to the same file asmake_napari_viewer
and adds_mock_app
tomake_napari_viewer
explicitly. We also remove theautouse
flag in favour of explicitly adding_mock_app
to tests that require theNapariApplication
- note that tests usingmake_napari_viewer
will still use to the mock application without needing to be changed.