File tree Expand file tree Collapse file tree 3 files changed +26
-9
lines changed
Expand file tree Collapse file tree 3 files changed +26
-9
lines changed Original file line number Diff line number Diff line change @@ -28,12 +28,7 @@ requirements:
2828 - pyhdf
2929 # This next one is needed to fix the app name on Mac
3030 - pyobjc-framework-cocoa # [osx]
31- # Lock the PySide6 version to be less than 6.8 for Mac.
32- # This is because Qt 6.8 has some crashing issue we need
33- # to resolve. This issue is tracked in:
34- # https://github.com/HEXRD/hexrdgui/issues/1931
35- - pyside6<6.8 # [osx]
36- - pyside6 # [not osx]
31+ - pyside6
3732 - pyyaml
3833 - silx-base
3934
Original file line number Diff line number Diff line change 88 'fabio>=0.11' ,
99 'matplotlib' ,
1010 'Pillow' ,
11- # PySide 6.8.0 is causing segmentation faults in the testing
12- # Keep this version downgraded until that is fixed.
13- 'pyside6<6.8.0' ,
11+ 'pyside6' ,
1412 'pyyaml' ,
1513 'silx' ,
1614]
Original file line number Diff line number Diff line change 1+ import gc
12import os
23from pathlib import Path
34
45import pytest
56
67from PySide6 .QtCore import QSettings
8+ from PySide6 .QtWidgets import QApplication
79
810from hexrdgui .main_window import MainWindow
911
@@ -41,3 +43,25 @@ def main_window(qtbot):
4143 window .confirm_application_close = False
4244 qtbot .addWidget (window .ui )
4345 return window
46+
47+
48+ # This next fixture is necessary starting in Qt 6.8, to ensure
49+ # all Qt objects are destroyed before Python finalizes.
50+ # This may not be required anymore after we drop support
51+ # for Python 3.11. The Python3.14 tests pass without it. We
52+ # can try removing this after we drop support of Python versions.
53+ @pytest .fixture (scope = "session" , autouse = True )
54+ def cleanup_qt ():
55+ """Clean up Qt objects before Python finalizes."""
56+ yield
57+ # After all tests complete, before Python exits
58+ app = QApplication .instance ()
59+ if app :
60+ # Close all windows
61+ for widget in app .topLevelWidgets ():
62+ widget .close ()
63+ widget .deleteLater ()
64+ # Process pending events
65+ app .processEvents ()
66+ # Force garbage collection
67+ gc .collect ()
You can’t perform that action at this time.
0 commit comments