[TIP] pytest fixtures started after unittest.TestCase.setUpClass

Bruno Oliveira nicoddemus at gmail.com
Thu Jan 4 15:51:06 PST 2018


Hi Dan,

(Cool to know you use pytest-qt :))

On Thu, Jan 4, 2018 at 7:31 PM Dan Nealschneider <
dan.nealschneider at schrodinger.com> wrote:

> 1. How should I ensure that start_qapp is run before any test or test
> setup?
>

Unfortunately the only way I know of is to change your setUpClass method
into an autouse fixture, this technique is detailed here:
https://github.com/pytest-dev/pytest/issues/517#issuecomment-128150676



> 2. Does this seem like a bug/RFE that I should report to pytest?
>

This has actually been discussed extensively [1] and there is an
implementation idea which is easy to implement and would make xunit
setup/fixtures work better together [2] but there's the concern of breaking
backward compatibility: definitely there are people who depend on the
current behavior and just changing this would break their test suite in
subtle and no fun ways [3].

[1] https://github.com/pytest-dev/pytest/issues/517
[2] https://github.com/pytest-dev/pytest/issues/517#issuecomment-228830714
[3] https://github.com/pytest-dev/pytest/issues/517#issuecomment-229506416

Cheers,
Bruno.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20180104/95d7377d/attachment.htm>


More information about the testing-in-python mailing list