Allow user to set a base Qt window style #2251

Merged
PeterSurda merged 7 commits from gitea-91 into v0.6 2024-06-16 06:43:57 +02:00
2 changed files with 21 additions and 10 deletions
Showing only changes of commit 21bef1058d - Show all commits

View File

@ -1,9 +1,9 @@
"""bitmessageqt tests"""
from addressbook import TestAddressbook
from main import TestMain, TestUISignaler
from settings import TestSettings
from support import TestSupport
from .addressbook import TestAddressbook
from .main import TestMain, TestUISignaler
from .settings import TestSettings
from .support import TestSupport
__all__ = [
"TestAddressbook", "TestMain", "TestSettings", "TestSupport",

View File

@ -1,19 +1,23 @@
"""Common definitions for bitmessageqt tests"""
import Queue
import sys
import unittest
from PyQt4 import QtCore, QtGui
from six.moves import queue
import bitmessageqt
import queues
from tr import _translate
from bitmessageqt import _translate, config, queues
class TestBase(unittest.TestCase):
"""Base class for bitmessageqt test case"""
@classmethod
def setUpClass(cls):
"""Provide the UI test cases with common settings"""
cls.config = config
def setUp(self):
self.app = (
QtGui.QApplication.instance()
@ -24,14 +28,21 @@ class TestBase(unittest.TestCase):
self.window.appIndicatorInit(self.app)
def tearDown(self):
"""Search for exceptions in closures called by timer and fail if any"""
# self.app.deleteLater()
concerning = []
while True:
try:
thread, exc = queues.excQueue.get(block=False)
except Queue.Empty:
return
except queue.Empty:
break
if thread == 'tests':
self.fail('Exception in the main thread: %s' % exc)
concerning.append(exc)
if concerning:
self.fail(
'Exceptions found in the main thread:\n%s' % '\n'.join((
str(e) for e in concerning
)))
class TestMain(unittest.TestCase):