better test helper which fails when unexpected exception happens