File tree 1 file changed +18
-2
lines changed
1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -275,8 +275,24 @@ def create_application():
275
275
# The try/except is necessary to run the main window tests on their own.
276
276
try :
277
277
app .set_font ()
278
- except AttributeError :
279
- pass
278
+ except AttributeError as error :
279
+ if running_under_pytest ():
280
+ # Set font options to avoid a ton of Qt warnings when running the
281
+ # tests.
282
+
283
+ # Set app font
284
+ app_family = app .font ().family ()
285
+ app_size = app .font ().pointSize ()
286
+ CONF .set ('appearance' , 'app_font/family' , app_family )
287
+ CONF .set ('appearance' , 'app_font/size' , app_size )
288
+
289
+ # Set monospace interface font
290
+ from spyder .config .fonts import MEDIUM , MONOSPACE
291
+ CONF .set ('appearance' , 'monospace_app_font/family' , MONOSPACE [0 ])
292
+ CONF .set ('appearance' , 'monospace_app_font/size' , MEDIUM )
293
+ else :
294
+ # Raise in case the error is valid
295
+ raise error
280
296
281
297
# Required for correct icon on GNOME/Wayland:
282
298
if hasattr (app , 'setDesktopFileName' ):
You can’t perform that action at this time.
0 commit comments