Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions tests/units/test_var.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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 <class 'str'> has no attribute 'foo' or may have been annotated wrongly."
)


@pytest.mark.parametrize(
Expand Down
Loading