The test methods are not printed in order in the junit report
Closed this issue · 2 comments
Hi,
I have been using pytest-ordering and it works/fits my usecase. Thank you for providing this plugin.
Whenever I generate the junit xml report, the tests are not in order they are executed in the report. Is it possible to re-order based on the order they are executed ?
Hi there.
I'm not too familiar with pytest's junit report, as I have not used it myself. In reading through the code briefly, (https://bitbucket.org/hpk42/pytest/src/fb399a582553ac8180e5706ad0e34149da85436e/_pytest/junitxml.py?at=default) it may have something to do with the relative order that pytest's hooks are called. If, as you say, tests are being reported in a different order than they are being run, perhaps the pytest_collection_modifyitems
hook is being called after some of the other hooks that are doing the junit reporting.
I'm willing to make changes to pytest-ordering to support junit, but I'm not sure what those changes would be. Sorry I can't be more helpful for now.
I'm willing to accept PRs for the above behavior, but I don't plan on tackling it myself.