-
Notifications
You must be signed in to change notification settings - Fork 24
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
fix assertion in tests, add new test for blockon usage in fixture #26
Conversation
OK, this showed up few bigger issues. First of all, Frankly speaking, I'm not a huge fan of this new But still, I've tried to make current version compatible with direct test-level reactor imports by moving plugin reactor initialization to |
@ybilopolov Thanks for this. Custom plugin hook sounds good to me. |
I've read #16 more carefully and see that there was a requirement to call |
@ybilopolov I am not familiar with qt too, but I guess that this is necessary to create the QApplication instance before qt5reactor.install call. |
Another strange behavior |
@ybilopolov Qt calls it's thing an event loop rather than a reactor but it's roughly the same thing as Twisted at that level. While there is QEventLoop, QApplication is generally how you get the primary event loop created (and whatever else QApplication does). So, to have a qt5reactor you need to have a QApplication. This fixture approach was recommended by @nicoddemus afair so perhaps they can weigh in on the plugin alternative. Even in the original implementation we expected to be able to create a reactor at the time of plugin configuration which is also when the reactor cli option can be parsed so the developer has to manually pick the reactor to match whatever was set on the cli. Point being that even that isn't nice. I'm not particularly familiar with Pluggy so perhaps you could explain the custom plugin hook? When would this run? Would it be another module on PyPI for each (non-default) reactor you may choose to use? My impression is that the Twisted approach of importing the reactor seems problematic exactly because it causes us to have these global get/create attempts that are racing to be first. I haven't discussed it in any detail but it just seems like an the obvious issue with singletons. Sure, you only want one event loop (in the 'normal' case) but you could still have On the more detailed side, where does the qapp/QApplication get created now? It seems to be completely missing yet tests are passing. :[ |
I proposed that because usually If you don't want to rely on the fixture being present (makes sense because the user might not be using The |
There was a bug in
assert_outcomes
which made tests never fail.