3

For example, if I have:

@pytest.mark.usefixtures("fixture1", "fixture2", "fixture3")
class TestFunction:
    .........

Let's say fixture1, fixture2 and fixture3 are independent class level fixtures. Is it true that the execution order is always 1->2->3 during setup and 3->2->1 during teardown?

If not, is there a way to enforce it?

Thanks,

Hao Shen
  • 2,605
  • 3
  • 37
  • 68
  • If you want to enforce it, why not make fixtures dependent on each other? – The Compiler Apr 04 '17 at 03:12
  • @compiler The reason is that then there is no way to select different fixtures for different classes. I just didn't get the point that if I need to make them dependent on each other, why don't I just make them as one fixture? – Hao Shen Apr 04 '17 at 17:16

0 Answers0