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

What is the recommended way to randomize as default but override using ordering?

Open fredrikaverpil opened this issue 5 years ago • 1 comments

I wish to run as many tests as possible using a random order and have this as the default. But for the ones which cannot run in random order, I wish to mark them somehow rather than executing several different commands in the terminal.

Will pytest-ordering work for this if I have pytest-randomly installed as well?

fredrikaverpil avatar Aug 30 '20 22:08 fredrikaverpil

I'm not sure if pytest-ordering will combine nicely - it depends in which order the plugins' ordering modification gets run. I think you should try it and see.

I imagine your use case is some tests which don't work in random order? I'd suggest keeping a branch with pytest-randomly reordering active, running it occasionally to discover the unreorderable tests, and fixing them iteratively on your trunk branch until the pytest-randomly branch works.

adamchainz avatar Aug 31 '20 08:08 adamchainz