tests: Make sure QWebEnginePage is deleted early
If we use the "webengineview" fixture and access QWebEngineProfile.defaultProfile(), it could happen that the profile outlives the page. In that case, we get a warning on pytest shutdown: Release of profile requested but WebEnginePage still not deleted. Expect troubles ! Thus, let's make sure the page is cleaned up earlier.
This commit is contained in:
parent
282b2b99e8
commit
e6ae8797e7
|
|
@ -444,7 +444,8 @@ def webengineview(qtbot, monkeypatch, web_tab_setup):
|
|||
monkeypatch.setattr(objects, 'backend', usertypes.Backend.QtWebEngine)
|
||||
view = QtWebEngineWidgets.QWebEngineView()
|
||||
qtbot.add_widget(view)
|
||||
return view
|
||||
yield view
|
||||
view.setPage(None) # Avoid warning if using QWebEngineProfile
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
|
|
|||
Loading…
Reference in New Issue