@pytest.fixture
def webview(qtbot, webpage):
 QtWebKitWidgets = pytest.importorskip('PyQt5.QtWebKitWidgets')
 view = QtWebKitWidgets.QWebView()
 qtbot.add_widget(view)
 view.page().deleteLater()
 view.setPage(webpage)
 view.resize(640, 480)
 return view

@ pytest . fixture def webview ( qtbot , webpage ) : QtWebKitWidgets = pytest . importorskip ( 'PyQt5.QtWebKitWidgets' ) view = QtWebKitWidgets . QWebView ( ) qtbot . add_widget ( view ) view . page ( ) . deleteLater ( ) view . setPage ( webpage ) view . resize ( 640 , 480 ) return view
get a new qwebview object .