Reset CaretBrowsingEnabled to original value.
This commit is contained in:
parent
2775f2b2ee
commit
9fde38d96a
@ -26,11 +26,14 @@ from PyQt5.QtWebKit import QWebSettings
|
|||||||
from PyQt5.QtWebKitWidgets import QWebPage
|
from PyQt5.QtWebKitWidgets import QWebPage
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(autouse=True)
|
@pytest.yield_fixture(autouse=True)
|
||||||
def enable_caret_browsing():
|
def enable_caret_browsing():
|
||||||
"""Fixture to enable caret browsing globally."""
|
"""Fixture to enable caret browsing globally."""
|
||||||
QWebSettings.globalSettings().setAttribute(
|
settings = QWebSettings.globalSettings()
|
||||||
QWebSettings.CaretBrowsingEnabled, True)
|
old_value = settings.testAttribute(QWebSettings.CaretBrowsingEnabled)
|
||||||
|
settings.setAttribute(QWebSettings.CaretBrowsingEnabled, True)
|
||||||
|
yield
|
||||||
|
settings.setAttribute(QWebSettings.CaretBrowsingEnabled, old_value)
|
||||||
|
|
||||||
|
|
||||||
class CaretTester:
|
class CaretTester:
|
||||||
|
Loading…
Reference in New Issue
Block a user