1

Can anyone confirm the order in which pytest executes the tests? For basic tests (no fixture parameterization), it appears to perform the tests based on the sequential naming order of the test modules and then the order of test functions within the module. However, what is the order when you start to add in parametrization for fixtures (including indirect parametrization)? So far, I've been unable to find any clear details online about this.

Thanks

felix001
  • 15,341
  • 32
  • 94
  • 121
  • 2
    In theory it's arbitrary and you're supposed to write your tests in such a way that the order in which they're executed doesn't matter. Lots of good info in this question if you need to enforce a particular ordering: https://stackoverflow.com/questions/17571438/test-case-execution-order-in-pytest – Samwise Feb 06 '23 at 14:25
  • Does this answer your question? [Test case execution order in pytest](https://stackoverflow.com/questions/17571438/test-case-execution-order-in-pytest) – Dorian Turba Feb 06 '23 at 15:39

0 Answers0