From 7dd908bd51ed38a9ce9d8b5714d607c7a1462535 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 19 Feb 2015 10:03:19 +0100 Subject: [PATCH 1/3] Try calling sip.delete on the test QApplication. Maybe this helps with the unit tests on Windows? --- qutebrowser/test/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qutebrowser/test/__init__.py b/qutebrowser/test/__init__.py index a8cb56fdb..a17e82337 100644 --- a/qutebrowser/test/__init__.py +++ b/qutebrowser/test/__init__.py @@ -20,10 +20,12 @@ """The qutebrowser test suite.""" import atexit +import functools +import sip from PyQt5.QtWidgets import QApplication # We create a singleton QApplication here. qApp = QApplication([]) -atexit.register(qApp.quit) +atexit.register(functools.partial(sip.delete, qApp)) From 852fe2f84caba4356e42a859c1782246e4533efb Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 19 Feb 2015 10:41:04 +0100 Subject: [PATCH 2/3] Try another workaround for broken Windows tests. --- qutebrowser/test/__init__.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/qutebrowser/test/__init__.py b/qutebrowser/test/__init__.py index a17e82337..299255119 100644 --- a/qutebrowser/test/__init__.py +++ b/qutebrowser/test/__init__.py @@ -19,13 +19,15 @@ """The qutebrowser test suite.""" -import atexit -import functools - -import sip +from PyQt5.QtCore import qInstallMessageHandler from PyQt5.QtWidgets import QApplication -# We create a singleton QApplication here. -qApp = QApplication([]) -atexit.register(functools.partial(sip.delete, qApp)) +def qt_message_handler(msg_type, context, msg): + print("Qt message: {}".format(msg)) + + +# We create a singleton QApplication here. +app = QApplication([]) +qInstallMessageHandler(qt_message_handler) + From 81fb57bbf09bfce45ddb928c2ad9e07f0d2f8dab Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 19 Feb 2015 16:59:33 +0100 Subject: [PATCH 3/3] Revert "Try another workaround for broken Windows tests." This reverts commit 852fe2f84caba4356e42a859c1782246e4533efb. --- qutebrowser/test/__init__.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/qutebrowser/test/__init__.py b/qutebrowser/test/__init__.py index 299255119..a17e82337 100644 --- a/qutebrowser/test/__init__.py +++ b/qutebrowser/test/__init__.py @@ -19,15 +19,13 @@ """The qutebrowser test suite.""" -from PyQt5.QtCore import qInstallMessageHandler +import atexit +import functools + +import sip from PyQt5.QtWidgets import QApplication - -def qt_message_handler(msg_type, context, msg): - print("Qt message: {}".format(msg)) - - # We create a singleton QApplication here. -app = QApplication([]) -qInstallMessageHandler(qt_message_handler) +qApp = QApplication([]) +atexit.register(functools.partial(sip.delete, qApp))