From f55b9ef3ceb4838208a244815b0a6cdf1cc30752 Mon Sep 17 00:00:00 2001 From: rgerum <14153051+rgerum@users.noreply.github.com> Date: Tue, 21 Jan 2025 12:14:09 -0500 Subject: [PATCH] tests get current app instance if there already is one --- test/test_use_gui.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/test_use_gui.py b/test/test_use_gui.py index c5507b0..3bebb28 100644 --- a/test/test_use_gui.py +++ b/test/test_use_gui.py @@ -41,7 +41,10 @@ def do_raise(_, name, desc): # Set the exception hook to our wrapping function sys.excepthook = lambda *args: sys._excepthook(*args) -app = QtWidgets.QApplication(sys.argv) +if not QtWidgets.QApplication.instance(): + app = QtWidgets.QApplication(sys.argv) +else: + app = QtWidgets.QApplication.instance() font = QtGui.QFont("Arial", 10) app.setFont(font)