def setUp(self, selected_category=None): self._cat = None self._app = None self.win = get_test_window_catview(self.db, selected_category) self.addCleanup(self.win.destroy) self.notebook = self.win.get_child() self.lobby = self.win.get_data("lobby") self.subcat_view = self.win.get_data("subcat")
def test_memleak_catview(self): db = get_test_db() win = get_test_window_catview(db) lobby = win.get_data("lobby") # get baseline do_events_with_sleep() with TraceMemoryUsage("LobbyView.on_db_reopen()"): for i in range(self.ITERATIONS): lobby._on_db_reopen(db) do_events_with_sleep()
def test_memleak_subcatview(self): db = get_test_db() win = get_test_window_catview(db) lobby = win.get_data("lobby") cat = [cat for cat in lobby.categories if cat.name == "Internet"][0] subcat = win.get_data("subcat") # get baseline subcat.set_subcategory(cat) do_events_with_sleep() with TraceMemoryUsage("SubcategoryView.set_subcategory()"): for i in range(self.ITERATIONS): subcat._set_subcategory(cat, 0) do_events_with_sleep()
def test_catview(self): win = get_test_window_catview() self.addCleanup(win.destroy)