From bb5fee4adcb4bb4e4a1ff70d98c4914fe0442984 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 8 Sep 2018 14:52:57 +0200 Subject: [PATCH] Also add a container for webengine_tab Seems to be needed with Qt < 5.11 for things to work. --- tests/helpers/fixtures.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/helpers/fixtures.py b/tests/helpers/fixtures.py index dd36620bb..227a78e2a 100644 --- a/tests/helpers/fixtures.py +++ b/tests/helpers/fixtures.py @@ -182,11 +182,18 @@ def webengine_tab(qtbot, tab_registry, fake_args, mode_manager, tabwidget.current_index = 0 tabwidget.index_of = 0 + container = QWidget() + qtbot.add_widget(container) + + vbox = QVBoxLayout(container) webenginetab = pytest.importorskip( 'qutebrowser.browser.webengine.webenginetab') tab = webenginetab.WebEngineTab(win_id=0, mode_manager=mode_manager, private=False) - qtbot.add_widget(tab) + vbox.addWidget(tab) + # to make sure container isn't GCed + tab.container = container + return tab