-
Notifications
You must be signed in to change notification settings - Fork 2
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
Document testing strategies and the use of the GuiTestAssistant #220
Comments
An example motivating problem (taken from a real project that was using Traits Futures): you're writing a UI that fires off various background tasks and gets some |
The main point that needs documenting is the need to run the event loop until the desired outcome occurs. |
@mdickinson FWIW, we stumbled through writing tests for our application's usage of Traits Futures. Relaying that here hoping it will help with deciding the priority of this issue. Thanks! |
@stpotter16 Please could you take a look at #278 and see (a) if it helps, and (b) what additions / modifications would be useful for your use-case? |
This issue was partially addressed in #278. I'm leaving the issue open while we consider whether there's more than should be added to that documentation. For "Use of the GuiTestAssistant that's in Traits Futures", that should likely be a separate issue. The example in #278 used Pyface's |
@stpotter16 Actually, on second thoughts, rather than reviewing the already-merged PR, it would be better to go straight to the rendered docs: https://docs.enthought.com/traits-futures/dev/guide/testing.html |
@mdickinson Docs are useful as is. I've created an issue on our application's repo to update the affected tests and will link the docs there. Thanks! |
On testing with traits-futures, just an idea, would it be possible to use an implementation of e.g. The difficulty I ran into with (And other minor details is that The semi-private methods mentioned in #225 are useful to drive changes on a per-future level. However it requires one to dive into, and sometimes reimplementing, the call that where submitted to be run asynchronously. They also require a more detailed understanding of the lifecycle of states in traits-futures: All-in-all, more implementation detail-level knowledge is required. |
Do you have control over the tasks being tested? A solution I often use for this situation is to use |
Yes, that's one of the reasons that Traits Futures uses its own |
Whoops, sorry. It wasn't, but it is now. I thought we had a separate issue for that, but there's only this issue. |
It's possible, and we've done things like this in the past, but it's not trivial. |
I see why the
|
Deferring this. |
We need to document better how to test code that uses Traits Futures.
The text was updated successfully, but these errors were encountered: