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:
parent
a5d9661d73
commit
203233c894
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user