Closed DavideCanton closed 10 months ago
Hey @DavideCanton thanks for the detailed problem description!
Indeed it seems you are correct, it definitely seems like an oversight on our part -- the intention is to reproduce exactly what was executed, so the order of course matters.
Would you like to open a PR? I would be happy to review one.
Sure, in the next days, I'll create a PR!
Awesome, thanks!
Currently, pytest-replay does not respect the order in the replay file, but it just filters the tests in the order collected by pytest:
After reading the implementation of
pytest_collection_modifyitems
in the plugin, I've seen that this is how the plugin is implemented now, since it just loads a set of nodeids from the replay, but it is used just to filter away the unselected items.Tweaking a bit the function I've managed to reproduce what I expected:
The implementation is a bit raw since it was just a test.
What about adding this feature, maybe with it being optional and disabled by default? I can provide a PR if it's feasible to add as a feature.