@@ -28,6 +28,7 @@ def test_ancillary_update_init(qtbot):
2828 model_key = "test1" ):
2929
3030 main_window = pyjibe .head .PyJibe ()
31+ qtbot .addWidget (main_window )
3132 main_window .load_data (files = make_directory_with_data (2 ))
3233 war = main_window .subwindows [0 ].widget ()
3334 # clear data
@@ -57,6 +58,7 @@ def test_ancillary_update_init(qtbot):
5758 war .list_curves .setCurrentItem (it )
5859 assert itab .item (0 , 1 ).text () == "2000"
5960 assert atab .item (0 , 1 ).text () == "2000"
61+ main_window .close ()
6062
6163
6264def test_ancillary_update_nan (qtbot ):
@@ -68,6 +70,7 @@ def test_ancillary_update_nan(qtbot):
6870 model_key = "test1" ):
6971
7072 main_window = pyjibe .head .PyJibe ()
73+ qtbot .addWidget (main_window )
7174 main_window .load_data (files = make_directory_with_data (2 ))
7275 war = main_window .subwindows [0 ].widget ()
7376 # clear data
@@ -85,6 +88,7 @@ def test_ancillary_update_nan(qtbot):
8588 atab = war .tab_fit .table_parameters_anc
8689 assert atab .item (0 , 1 ).text () == "nan"
8790 assert itab .item (0 , 1 ).text () == "3000"
91+ main_window .close ()
8892
8993
9094def test_ancillary_update_preproc_change (qtbot ):
@@ -98,6 +102,7 @@ def test_ancillary_update_preproc_change(qtbot):
98102 model_key = "test1" ):
99103
100104 main_window = pyjibe .head .PyJibe ()
105+ qtbot .addWidget (main_window )
101106 main_window .load_data (files = make_directory_with_data (2 ))
102107 war = main_window .subwindows [0 ].widget ()
103108 # clear data
@@ -130,6 +135,7 @@ def test_ancillary_update_preproc_change(qtbot):
130135 assert len (war .tab_preprocess .current_preprocessing ()[0 ]) == 2
131136 assert atab .item (0 , 1 ).text () == "2345"
132137 assert itab .item (0 , 1 ).text () == "2345"
138+ main_window .close ()
133139
134140
135141@pytest .mark .filterwarnings ('ignore::UserWarning' )
@@ -153,6 +159,7 @@ def test_apply_and_fit_all_with_bad_data(qtbot, monkeypatch):
153159
154160 # initialize
155161 main_window = pyjibe .head .PyJibe ()
162+ qtbot .addWidget (main_window )
156163 main_window .load_data (files = files )
157164 war = main_window .subwindows [0 ].widget ()
158165 war .tab_preprocess .set_preprocessing (
@@ -173,10 +180,12 @@ def test_apply_and_fit_all_with_bad_data(qtbot, monkeypatch):
173180 assert float (bad .data (2 , 0 )) == - 1 # column 2 shows the rating
174181 good2 = war .list_curves .topLevelItem (2 )
175182 assert float (good2 .data (2 , 0 )) > 0 # column 2 shows the rating
183+ main_window .close ()
176184
177185
178186def test_change_model_keep_parms (qtbot ):
179187 main_window = pyjibe .head .PyJibe ()
188+ qtbot .addWidget (main_window )
180189 main_window .load_data (files = make_directory_with_data (2 ))
181190 war = main_window .subwindows [0 ].widget ()
182191 # clear data
@@ -194,10 +203,12 @@ def test_change_model_keep_parms(qtbot):
194203 war .tab_fit .cb_model .setCurrentIndex (pyr_idx )
195204 # check that contact point is still the same
196205 assert float (itab .item (3 , 1 ).text ()) == 12345
206+ main_window .close ()
197207
198208
199209def test_remember_initial_params (qtbot ):
200210 main_window = pyjibe .head .PyJibe ()
211+ qtbot .addWidget (main_window )
201212 main_window .load_data (files = make_directory_with_data (2 ))
202213 war = main_window .subwindows [0 ].widget ()
203214 # clear data
@@ -220,10 +231,12 @@ def test_remember_initial_params(qtbot):
220231 cl2 = war .list_curves .itemBelow (cl1 )
221232 war .list_curves .setCurrentItem (cl2 )
222233 assert float (itab .item (1 , 1 ).text ()) == 5
234+ main_window .close ()
223235
224236
225237def test_set_indentation_depth_manually_infdoublespinbox (qtbot ):
226238 main_window = pyjibe .head .PyJibe ()
239+ qtbot .addWidget (main_window )
227240 main_window .load_data (files = make_directory_with_data (2 ))
228241 war = main_window .subwindows [0 ].widget ()
229242 # perform fitting with standard parameters
@@ -248,3 +261,4 @@ def test_set_indentation_depth_manually_infdoublespinbox(qtbot):
248261 war .tab_fit .sp_range_1 .clear ()
249262 qtbot .keyClicks (war .tab_fit .sp_range_1 , text_entered )
250263 assert war .tab_fit .sp_range_1 .value () == resulting_value
264+ main_window .close ()
0 commit comments