To have a better view on real failures, we should retry failed tests. If the retry failed too, then the random bug seems not so random.
There is the pytest-cache plugin, already included in the default installation, which provides this option:
--lf, --last-failed - to only re-run the failures.
For our usage, we could simply relaunch the same command but with this argument added.