Get the tests to pass with webengine

This commit is contained in:
Kovid Goyal 2019-07-14 17:17:18 +05:30
parent a528cef0ee
commit dfc09ede98
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 0 deletions

View File

@ -870,6 +870,7 @@ class Application(QApplication):
QApplication.setApplicationName(APP_UID)
if override_program_name and hasattr(QApplication, 'setDesktopFileName'):
QApplication.setDesktopFileName(override_program_name)
QApplication.setAttribute(Qt.AA_ShareOpenGLContexts, True) # needed for webengine
QApplication.__init__(self, qargs)
self.setAttribute(Qt.AA_UseHighDpiPixmaps)
self.setAttribute(Qt.AA_SynthesizeTouchForUnhandledMouseEvents, False)

View File

@ -182,6 +182,7 @@ class BuildTest(unittest.TestCase):
@unittest.skipIf('SKIP_QT_BUILD_TEST' in os.environ, 'Skipping Qt build test as it causes crashes in the macOS VM')
def test_qt(self):
from PyQt5.QtWebEngineWidgets import QWebEnginePage
from PyQt5.QtGui import QImageReader, QFontDatabase
from PyQt5.QtNetwork import QNetworkAccessManager
from calibre.utils.img import image_from_data, image_to_data, test
@ -219,6 +220,7 @@ class BuildTest(unittest.TestCase):
QtWin
del na
del app
del QWebEnginePage
def test_imaging(self):
from PIL import Image