pytest-random-order
pytest-random-order copied to clipboard
return in finally swallows exceptions
In https://github.com/pytest-dev/pytest-random-order/blob/ac1369a174a6f4a2cca295e73c4c6b04c613888c/random_order/shuffler.py#L100 there is a return statement in a finally block, which would swallow any in-flight exception.
This means that if any exception (including BaseException such as KeyboardInterrupt) is raised from the try body, it will not propagate on as expected.
See also https://docs.python.org/3/tutorial/errors.html#defining-clean-up-actions.