@@ -28,6 +28,7 @@ def test_ancillary_update_init(qtbot):
28
28
model_key = "test1" ):
29
29
30
30
main_window = pyjibe .head .PyJibe ()
31
+ qtbot .addWidget (main_window )
31
32
main_window .load_data (files = make_directory_with_data (2 ))
32
33
war = main_window .subwindows [0 ].widget ()
33
34
# clear data
@@ -57,6 +58,7 @@ def test_ancillary_update_init(qtbot):
57
58
war .list_curves .setCurrentItem (it )
58
59
assert itab .item (0 , 1 ).text () == "2000"
59
60
assert atab .item (0 , 1 ).text () == "2000"
61
+ main_window .close ()
60
62
61
63
62
64
def test_ancillary_update_nan (qtbot ):
@@ -68,6 +70,7 @@ def test_ancillary_update_nan(qtbot):
68
70
model_key = "test1" ):
69
71
70
72
main_window = pyjibe .head .PyJibe ()
73
+ qtbot .addWidget (main_window )
71
74
main_window .load_data (files = make_directory_with_data (2 ))
72
75
war = main_window .subwindows [0 ].widget ()
73
76
# clear data
@@ -85,6 +88,7 @@ def test_ancillary_update_nan(qtbot):
85
88
atab = war .tab_fit .table_parameters_anc
86
89
assert atab .item (0 , 1 ).text () == "nan"
87
90
assert itab .item (0 , 1 ).text () == "3000"
91
+ main_window .close ()
88
92
89
93
90
94
def test_ancillary_update_preproc_change (qtbot ):
@@ -98,6 +102,7 @@ def test_ancillary_update_preproc_change(qtbot):
98
102
model_key = "test1" ):
99
103
100
104
main_window = pyjibe .head .PyJibe ()
105
+ qtbot .addWidget (main_window )
101
106
main_window .load_data (files = make_directory_with_data (2 ))
102
107
war = main_window .subwindows [0 ].widget ()
103
108
# clear data
@@ -130,6 +135,7 @@ def test_ancillary_update_preproc_change(qtbot):
130
135
assert len (war .tab_preprocess .current_preprocessing ()[0 ]) == 2
131
136
assert atab .item (0 , 1 ).text () == "2345"
132
137
assert itab .item (0 , 1 ).text () == "2345"
138
+ main_window .close ()
133
139
134
140
135
141
@pytest .mark .filterwarnings ('ignore::UserWarning' )
@@ -153,6 +159,7 @@ def test_apply_and_fit_all_with_bad_data(qtbot, monkeypatch):
153
159
154
160
# initialize
155
161
main_window = pyjibe .head .PyJibe ()
162
+ qtbot .addWidget (main_window )
156
163
main_window .load_data (files = files )
157
164
war = main_window .subwindows [0 ].widget ()
158
165
war .tab_preprocess .set_preprocessing (
@@ -173,10 +180,12 @@ def test_apply_and_fit_all_with_bad_data(qtbot, monkeypatch):
173
180
assert float (bad .data (2 , 0 )) == - 1 # column 2 shows the rating
174
181
good2 = war .list_curves .topLevelItem (2 )
175
182
assert float (good2 .data (2 , 0 )) > 0 # column 2 shows the rating
183
+ main_window .close ()
176
184
177
185
178
186
def test_change_model_keep_parms (qtbot ):
179
187
main_window = pyjibe .head .PyJibe ()
188
+ qtbot .addWidget (main_window )
180
189
main_window .load_data (files = make_directory_with_data (2 ))
181
190
war = main_window .subwindows [0 ].widget ()
182
191
# clear data
@@ -194,10 +203,12 @@ def test_change_model_keep_parms(qtbot):
194
203
war .tab_fit .cb_model .setCurrentIndex (pyr_idx )
195
204
# check that contact point is still the same
196
205
assert float (itab .item (3 , 1 ).text ()) == 12345
206
+ main_window .close ()
197
207
198
208
199
209
def test_remember_initial_params (qtbot ):
200
210
main_window = pyjibe .head .PyJibe ()
211
+ qtbot .addWidget (main_window )
201
212
main_window .load_data (files = make_directory_with_data (2 ))
202
213
war = main_window .subwindows [0 ].widget ()
203
214
# clear data
@@ -220,10 +231,12 @@ def test_remember_initial_params(qtbot):
220
231
cl2 = war .list_curves .itemBelow (cl1 )
221
232
war .list_curves .setCurrentItem (cl2 )
222
233
assert float (itab .item (1 , 1 ).text ()) == 5
234
+ main_window .close ()
223
235
224
236
225
237
def test_set_indentation_depth_manually_infdoublespinbox (qtbot ):
226
238
main_window = pyjibe .head .PyJibe ()
239
+ qtbot .addWidget (main_window )
227
240
main_window .load_data (files = make_directory_with_data (2 ))
228
241
war = main_window .subwindows [0 ].widget ()
229
242
# perform fitting with standard parameters
@@ -248,3 +261,4 @@ def test_set_indentation_depth_manually_infdoublespinbox(qtbot):
248
261
war .tab_fit .sp_range_1 .clear ()
249
262
qtbot .keyClicks (war .tab_fit .sp_range_1 , text_entered )
250
263
assert war .tab_fit .sp_range_1 .value () == resulting_value
264
+ main_window .close ()
0 commit comments