[TIP] pytest fixtures started after unittest.TestCase.setUpClass
dan.nealschneider at schrodinger.com
Thu Jan 4 16:53:41 PST 2018
On Thu, Jan 4, 2018 at 3:51 PM, Bruno Oliveira <nicoddemus at gmail.com> wrote:
> Hi Dan,
> (Cool to know you use pytest-qt :))
We don't actually use pytest qt! I'd love to, but the way that our current
qt-based tests run is problematic. I'll take your smiley face as a another
encouragement to move towards pytest-qt...
> On Thu, Jan 4, 2018 at 7:31 PM Dan Nealschneider <dan.nealschneider@
> schrodinger.com> wrote:
>> 1. How should I ensure that start_qapp is run before any test or test
> Unfortunately the only way I know of is to change your setUpClass method
> into an autouse fixture, this technique is detailed here:
Yeah, that's what I suspected... I can totally easily fix this one test,
but unfortunately we have tens of thousands of tests, so I won't be
updating them by hand super soon. It would be nice if unittest2pytest
updated setUp and setUpClass, then I could make some
serious progress. Maybe I'll take a stab at updating unittest2pytest.
>> 2. Does this seem like a bug/RFE that I should report to pytest?
> This has actually been discussed extensively  and there is an
> implementation idea which is easy to implement and would make xunit
> setup/fixtures work better together  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 .
>  https://github.com/pytest-dev/pytest/issues/517
>  https://github.com/pytest-dev/pytest/issues/517#issuecomment-228830714
>  https://github.com/pytest-dev/pytest/issues/517#issuecomment-229506416
Cool. Thanks, Bruno!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the testing-in-python