Fix test_history cleanup failure.
The test may be skipped if the PyQt5.QtWebKitWidget import fails, but the cleanup was still running and trying to delete a nonexistant web-history.
This commit is contained in:
parent
93e0bfa410
commit
4296eed429
@ -325,12 +325,12 @@ def test_history_interface(qtbot, webview, hist_interface):
|
|||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def cleanup_init():
|
def cleanup_init():
|
||||||
yield
|
|
||||||
# prevent test_init from leaking state
|
# prevent test_init from leaking state
|
||||||
|
yield
|
||||||
|
try:
|
||||||
hist = objreg.get('web-history')
|
hist = objreg.get('web-history')
|
||||||
hist.setParent(None)
|
hist.setParent(None)
|
||||||
objreg.delete('web-history')
|
objreg.delete('web-history')
|
||||||
try:
|
|
||||||
from PyQt5.QtWebKit import QWebHistoryInterface
|
from PyQt5.QtWebKit import QWebHistoryInterface
|
||||||
QWebHistoryInterface.setDefaultInterface(None)
|
QWebHistoryInterface.setDefaultInterface(None)
|
||||||
except:
|
except:
|
||||||
|
Loading…
Reference in New Issue
Block a user