test_history.test_init also leaked state by leaving the instantiated history as the parent of the QApp, which was causing test_debug to fail because it was trying to dump the history object left from test_history.