Add captured context manager to the test helpers