[openlp-dev] Moving to pytest fixtures

Raoul Snyman raoul at snyman.info
Tue Oct 8 18:28:58 EDT 2019


On 2019-10-08 15:22, Benjamin Hoving wrote:
> The basic problem is that the QApplication object is only meant to be
> instantiated once for the lifetime of the application, which is what
> happens during the normal execution of OpenLP, but during testing, the
> QApplication is created and destroyed many times and references to the
> object may not always be torn down between tests. I personally suspect
> (though I have not had a chance to fully investigate) that the
> Settings object or some of the singleton objects may be keeping
> references to the QApplication object. (for instance, I know that the
> Registry singleton is explicitly given a reference to the QApplication
> object and I don't think the Registry object is destroyed between
> tests). This makes it very difficult to pinpoint the actual point of
> failure for a test because the point of failure may be caused as a
> side effect of another test failing to tear the environment down
> properly. (i.e. one that initialized the Registry and gave it a
> QApplication reference, but did not reset the Registry).

Aha. You might be onto something here. I'm not sure how well we reset 
the Registry object, if at all, during tests.

-- 
Raoul Snyman
raoul at snyman.info


More information about the openlp-dev mailing list