nested looping of a test inside of a scenario produces unexpected execution order #8545
Replies: 1 comment
|
Hi @spleshakov The two pytest's collection/scheduling machinery groups parametrized items according to scopes and fixture/resource setup needs. The resulting order should therefore not be used as application semantics. If your tests depend on this sequence, I would remove that dependency. If the specific requirement is that def test_3(self, a, subtests):
for b in ("b1", "b2", "b3"):
with subtests.test(b=b):
check(a, b)This preserves the If every Please mark this answer as accepted if it helped, thank you. |
Uh oh!
There was an error while loading. Please reload this page.
I need to get the following order of tests
Given that
Produces
and
produces
I would expect that
should do the work... But instead I get
Why is this happening and how to solve it?
Thanks!
All reactions