Open GenevieveBuckley opened 11 months ago
I do not like this. In the past, the make_napari_vewer
fixture create problems (even now it crashes https://github.com/napari/napari/pull/6340). We should propagate to write unit tests, not integration tests.
So, I prefer to directly connect signals and not use a viewer if unnecessary.
📚 New content request
Suggest adding a small section to the guide on threading in napari to include a small demo on how to test functions involving threading.
Outline
Testing functions involving thread workers
When writing tests for your code, sometimes you want the test to wait for the thread worker to finish and return the data, so that you can make assertions about the result. For this, use the
await_workers()
method.Here is an example: