[openlp-dev] Moving to pytest fixtures

Benjamin Hoving benjamin.hoving at gmail.com
Tue Oct 8 18:32:27 EDT 2019


I haven't had a chance to try anything, but I think the fix for that would be to call Registry().create() before each test, which could be done easily (and even automatically, I think) from a fixture.
On 10/8/2019 6:29:07 PM, Raoul Snyman via openlp-dev <openlp-dev at openlp.io> wrote:
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
_______________________________________________
openlp-dev mailing list
openlp-dev at openlp.io
https://lists.openlp.io/mailman/listinfo/openlp-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openlp.io/pipermail/openlp-dev/attachments/20191008/14157664/attachment-0001.html>


More information about the openlp-dev mailing list