assert_invalid accepts expected Exception to be thrown