Open
Description
Description of issue or feature request:
In tests we use the home-made decorator @utils.run_sub_tests_with_dataset
when we need to execute the same test case consecutively for many datasets. The decorator works perfectly fine when no clean up is needed after each sub test but in the cases where clean up code needs to be executed, the whole sub test needs to be included in a "try - finally" block in order to run the clean up code even if a sub test fails.
Expected behavior:
Improve the decorator by possibly including the clean up logic in it to avoid the big "try" blocks in the test code.
See #1689 (comment)