During numerous tries to get unittest + wxPython working together I found
one strange problem. If I try to make several instances of wxApp
(sequentially, one-by-one, not concurrently), only the first instance
guarantied to works fine. Then I delete the first instance and try to
install the next one, then this subsequent copy can be 'partially unusable'.
This second instance can looks fine but some functions "freezes" then I call
them. Appears that at least posting events stuff is somehow became broken.
For example wx.CallAfter does not deliver the call to it's tagret (targeting
function newer became invoked).
My guessing is that some exceed "globalization" may be involved. For example
I notice that "pending events" queue is actually a global variable somethere
in wxWidgets sources. Can anybody comment this? I am almost successing in
my attempts (unittesting with wx) but this annoying behaviour is a big
roadblock I found.
Maybe there is a way to "kill completely" wxApp from the memory?
During numerous tries to get unittest + wxPython working together I found
one strange problem. If I try to make several instances of wxApp
(sequentially, one-by-one, not concurrently), only the first instance
guarantied to works fine. Then I delete the first instance and try to
install the next one, then this subsequent copy can be 'partially unusable'.
This second instance can looks fine but some functions "freezes" then I call
them. Appears that at least posting events stuff is somehow became broken.
For example wx.CallAfter does not deliver the call to it's tagret (targeting
function newer became invoked).
My guessing is that some exceed "globalization" may be involved. For example
I notice that "pending events" queue is actually a global variable somethere
in wxWidgets sources. Can anybody comment this? I am almost successing in
my attempts (unittesting with wx) but this annoying behaviour is a big
roadblock I found.
Maybe there is a way to "kill completely" wxApp from the memory?
wxWidgets assumes that there will only be a single instance of wxApp in the whole life-time of the process. You are correct, there are a number of globals that are initialized when the wxApp is created, and are only cleaned up when the wx._core module is removed from memory.