[openlp-dev] Moving to pytest fixtures

Raoul Snyman raoul at snyman.info
Thu Oct 10 01:38:23 EDT 2019

So I did some more digging... some observations:

1. The segfaults I'm running into are all in pytest's collection phase.
2. After a bunch of messing around I found two segfaults:
    - In settings.py, setting shortcuts when creating a new Settings 
    - In icons.py, getting the palette when creating a new UiIcons object
3. Both segfaults are due to no QApplication object existing at the 

 From this I can surmise that when collecting tests, pytest somehow runs 
the test methods, but doesn't run setUp or tearDown. Another reason to 
move to pytest fixtures, I guess.

With some defensive programming techniques in those two classes, I was 
able to get past collection. I re-enabled the application tests, and now 
I'm running into a segfault there, but it's at least further than I was 
previously getting.

Additionally, I removed the "global" QApplication object, and I 
introduced a "teardown_application()" to remove the app object.

I've pushed this code up to here, if anyone is interested:


Raoul Snyman
raoul at snyman.info

More information about the openlp-dev mailing list