diff --git a/tests/units/test_var.py b/tests/units/test_var.py index c7a64902084..1bb03eae9a1 100644 --- a/tests/units/test_var.py +++ b/tests/units/test_var.py @@ -782,11 +782,10 @@ def test_computed_var_without_annotation_error(request, fixture): with pytest.raises(TypeError) as err: state = request.getfixturevalue(fixture) state.var_without_annotation.foo - full_name = state.var_without_annotation._var_full_name - assert ( - err.value.args[0] - == f"You must provide an annotation for the state var `{full_name}`. Annotation cannot be `typing.Any`" - ) + assert ( + err.value.args[0] + == "Computed var 'var_without_annotation' must have a type annotation." + ) @pytest.mark.parametrize( @@ -827,11 +826,9 @@ def test_computed_var_with_annotation_error(request, fixture): with pytest.raises(AttributeError) as err: state = request.getfixturevalue(fixture) state.var_with_annotation.foo - full_name = state.var_with_annotation._var_full_name - assert ( - err.value.args[0] - == f"The State var `{full_name}` has no attribute 'foo' or may have been annotated wrongly." - ) + assert err.value.args[0].endswith( + "of type has no attribute 'foo' or may have been annotated wrongly." + ) @pytest.mark.parametrize(