fix: align contextual CSS rendering and Word styles

This commit is contained in:
2026-10-30 13:12:05 +08:00
parent cc4f91899e
commit f9bf62b71c
17 changed files with 313 additions and 53 deletions
+10
View File
@@ -8,6 +8,7 @@ os.environ.setdefault("QTWEBENGINE_CHROMIUM_FLAGS", "--disable-gpu --no-sandbox
import pytest
from PySide6.QtWidgets import QApplication
from PySide6.QtGui import QFontDatabase
from PySide6.QtCore import QCoreApplication, QEvent
@pytest.fixture(scope="session", autouse=True)
@@ -19,3 +20,12 @@ def qt_application():
QFontDatabase.addApplicationFont(os.path.join(os.environ.get("WINDIR", "C:/Windows"), "Fonts", "msyh.ttc"))
yield app
app.processEvents()
@pytest.fixture(autouse=True)
def release_closed_widgets(qt_application):
yield
# processEvents alone does not flush DeferredDelete without app.exec().
# Release closed WebEngine pages before the next rendering regression.
QCoreApplication.sendPostedEvents(None, QEvent.Type.DeferredDelete)
qt_application.processEvents()