Better scope the expected exception in test