What is the recommended way to randomize as default but override using ordering?
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?
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.