Needs a `try...finally` to prevent "dangling state" if the test fails.