pytest-csv icon indicating copy to clipboard operation
pytest-csv copied to clipboard

results.cvs row order not the same as what `pytest --co` returns for xdist

Open etse1288 opened this issue 2 years ago • 3 comments

Hi All, I have noticed that if I am using pytest with xdist the resulting CSV file will not have the same order as what pytest --co would return. I would like to confirm that this is indeed something not implemented/supported, before I go spend some time making it work. Thanks!

etse1288 avatar Jul 15 '22 00:07 etse1288

When using xdist test results are appended as they come, so order is not predictable. We could add an option to generate sorted output.

nicoulaj avatar Aug 13 '22 17:08 nicoulaj

@nicoulaj we have create a solutions for this. @etse1288 and I will request a merge for this feature. Please help review, the output will be sorted based 'id' from the column as this is the only section where we can match the input --co data with the output. @nicoulaj Can you review and approve the merge request if it full-fill the requirement? Thanks

inghowe83 avatar Aug 24 '22 02:08 inghowe83

@nicoulaj , we added xdist sort option. When this option is enable, it will sort the output of the csv

https://github.com/nicoulaj/pytest-csv/pull/23

inghowe83 avatar Sep 01 '22 00:09 inghowe83