On Tue, Dec 17, 2024 at 12:53:42PM +0000, Julian Gilbey wrote: > On Mon, Dec 16, 2024 at 01:58:14AM +0000, Colin Watson wrote: > > [...] > > * spyder: #1088068/#1089054. > > I'm struggling with this one; I've asked at > https://github.com/spyder-ide/spyder/issues/23074 > for help, but nothing so far. I've just pushed my current work to > salsa (g...@salsa.debian.org:science-team/spyder.git), and if anyone > has time to look into this, I'd really appreciate it.
I poked around a bit in pdb. I think the problem is that one plugin is calling the icon machinery at class creation time, before a QApplication or equivalent has been set up, so font loading doesn't happen. Since pytest goes through and loads all the Python files to look for tests, this causes it problems. This patch helps (borrowed from similar code in a different plugin); feel free to send it upstream if you think it makes sense: diff --git a/spyder/plugins/preferences/widgets/configdialog.py b/spyder/plugins/preferences/widgets/configdialog.py index c3f6bb3..d822431 100644 --- a/spyder/plugins/preferences/widgets/configdialog.py +++ b/spyder/plugins/preferences/widgets/configdialog.py @@ -28,11 +28,11 @@ class ConfigDialog(SidebarDialog): # Constants TITLE = _("Preferences") - ICON = ima.icon('configure') MIN_WIDTH = 940 if MAC else (875 if WIN else 920) MIN_HEIGHT = 700 if MAC else (660 if WIN else 670) def __init__(self, parent=None): + self.ICON = ima.icon('configure') SidebarDialog.__init__(self, parent) # Attributes With that, the tests are able to actually start up, although there are some other failures. It might be worth experimenting with whether upgrading yapf to a more recent upstream version would help with the rest? And it's a rather slow set of tests so I didn't wait for them to finish before sending this email. -- Colin Watson (he/him) [cjwat...@debian.org]