Track the view correctly in the webengineview fixture

This makes sure the view is closed after the test (fixing test_none on AppVeyor)
and also makes sure we have a QApplication.
This commit is contained in:
Florian Bruhin 2017-11-20 20:47:40 +01:00
parent a5d9661d73
commit 203233c894

View File

@ -315,10 +315,12 @@ def qnam(qapp):
@pytest.fixture @pytest.fixture
def webengineview(): def webengineview(qtbot):
"""Get a QWebEngineView if QtWebEngine is available.""" """Get a QWebEngineView if QtWebEngine is available."""
QtWebEngineWidgets = pytest.importorskip('PyQt5.QtWebEngineWidgets') QtWebEngineWidgets = pytest.importorskip('PyQt5.QtWebEngineWidgets')
return QtWebEngineWidgets.QWebEngineView() view = QtWebEngineWidgets.QWebEngineView()
qtbot.add_widget(view)
return view
@pytest.fixture @pytest.fixture