'When an extra attribute that isn\'t allowed in a given state
is provided, ``InvariantException`` is raised.
:param choice: A choice function
:param extra_value: A value to provide to the exta attribute'

@given(args=ALGEBRAIC_TYPE_ARGUMENTS_STRATEGY, choice=st.choices(), extra_value=st.booleans())
@example(args={'state': States.ALLOWED, 'extra': False}, choice=(lambda _: 'one'), extra_value=True)
@example(args={'state': States.WITH_ATTRIBUTE, 'extra': False, 'one': True}, choice=(lambda _: 'two'), extra_value=True)
def test_extra_attributes(self, args, choice, extra_value):

    state = args['state']
    invariant = AlgebraicType.__invariant__
    extra_attributes = (invariant._all_attributes - invariant.attributes_for_tag[state])
    assume(extra_attributes)
    extra_attribute = choice(sorted(extra_attributes))
    args[extra_attribute] = extra_value
    exc = self.assertRaises(InvariantException, AlgebraicType, **args)
    self.assertIn("can't    be    specified    in    state", exc.invariant_errors[0])
