You usually need one or two rounds of processing events to fire the window up and make it being shown. We'll have to live with that :)  That context manager sounds like a good idea for testing.