-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Fixture tear-down order broken in 5.3.3 #6512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Duplicate of #6492 |
Thanks @MarcSchmitzer, while it does seem like a duplicate, meanwhile if you can get a minimal reproducer it would be great; #6492 is under investigation still, so a reproducer would help a lot. |
/cc @SalmonMode this also seems not like a real duplicate of #6492. Let's verify/triage this separately for now. |
@MarcSchmitzer if possible, are you able to run |
Plans are here: plan-5.3.2.txt plan-5.3.3.txt. There's a lot of custom fixtures in there, I'm afraid. The relevant change is the second one: The Edited to add: The plan produced by 5.3.4 is identical to the 5.3.2 plan, by the way. |
I've been trying to pare down the test suite to isolate the problem, and it's really weird. I can make 5.3.3 produce a correct plan by removing test functions even though doing that doesn't change the set of used fixtures. This is so arbitrary, it almost seems like a dictionary order issue. But I'm on Python 3.6 here, so dictionary iteration should be in insertion order, right? |
@MarcSchmitzer
That matches what I've seen in pytest-django where the fixture order used in args is not deterministic anymore (flaky) it seems.
Yes. |
But |
@MarcSchmitzer a very interesting example. Thank you! Are you by any chance doing anything with pytest hooks, |
I have removed the few instances of |
@MarcSchmitzer can you try #6551, please? |
A change in pytest 5.3.3 (9918093, to be precise) broke fixture teardown for us. What happens is that fixture A depends on fixture B, but B gets torn down before A. This means that B is already torn down when A's tear-down code executes. Both fixtures have the same scope.
Reverting 9918093 on top of 5.3.3 restores the old behavior.
The test suite in question is quite involved. Sadly I haven't been able to create a minimal reproducer so far.
The contents of the virtualenv are here: pip-list.txt.
Pytest Version is 5.3.3, on Ubuntu 18.04.3, Python 3.6.8
The text was updated successfully, but these errors were encountered: