Skip to content

Commit

Permalink
fix using TestCaseQt from qapp_utils with python3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
t20100 committed Jul 13, 2023
1 parent 3a5368f commit 9e659e8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/silx/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def qapp_utils(qapp):
utils.setUpClass()
utils.setUp()
yield utils
utils.tearDown()
utils.tearDown(forceCheck=True)
utils.tearDownClass()


Expand Down
4 changes: 2 additions & 2 deletions src/silx/gui/utils/testutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,14 @@ def _checkForUnreleasedWidgets(self):
raise RuntimeError(
"Test ended with widgets alive: %s" % str(widgets))

def tearDown(self):
def tearDown(self, forceCheck: bool = False):
self.qapp.processEvents()

if len(self.__class__._exceptions) > 0:
messages = "\n".join(self.__class__._exceptions)
raise AssertionError("Exception occured in Qt thread:\n" + messages)

if self._currentTestSucceeded():
if forceCheck or self._currentTestSucceeded():
self._checkForUnreleasedWidgets()

@property
Expand Down

0 comments on commit 9e659e8

Please sign in to comment.