From 849706e310f75081255e5d979a3792986f466400 Mon Sep 17 00:00:00 2001 From: Ryan Roden-Corrent Date: Thu, 30 Jun 2016 07:19:36 -0400 Subject: [PATCH] Clean up Qt view used in completion tests. Add the view created during the tests to qtot so it gets cleaned up after the test exits. --- tests/unit/completion/test_models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/unit/completion/test_models.py b/tests/unit/completion/test_models.py index 1c39b6ea2..572291eb0 100644 --- a/tests/unit/completion/test_models.py +++ b/tests/unit/completion/test_models.py @@ -238,7 +238,7 @@ def test_tab_completion(stubs, qtbot, app_stub, win_registry, def test_tab_completion_delete(stubs, qtbot, app_stub, win_registry, - tabbed_browser_stubs): + tabbed_browser_stubs, qtbot): """Verify closing a tab by deleting it from the completion widget.""" tabbed_browser_stubs[0].tabs = [ stubs.FakeWebView(QUrl('https://github.com'), 'GitHub', 0), @@ -250,6 +250,7 @@ def test_tab_completion_delete(stubs, qtbot, app_stub, win_registry, ] model = miscmodels.TabCompletionModel() view = _mock_view_index(model, 0, 1) + qtbot.add_widget(view) model.delete_cur_item(view) actual = [tab.url() for tab in tabbed_browser_stubs[0].tabs] assert actual == [QUrl('https://github.com'),