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
|
||||
def cleanup_init():
|
||||
yield
|
||||
# prevent test_init from leaking state
|
||||
hist = objreg.get('web-history')
|
||||
hist.setParent(None)
|
||||
objreg.delete('web-history')
|
||||
yield
|
||||
try:
|
||||
hist = objreg.get('web-history')
|
||||
hist.setParent(None)
|
||||
objreg.delete('web-history')
|
||||
from PyQt5.QtWebKit import QWebHistoryInterface
|
||||
QWebHistoryInterface.setDefaultInterface(None)
|
||||
except:
|
||||
|
Loading…
Reference in New Issue
Block a user