Skip to content

Commit 55f2acd

Browse files
committed
Failing test
1 parent 7665bf5 commit 55f2acd

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/test_workflow.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,3 +418,26 @@ def test_workflow_init_not__init__():
418418
with pytest.raises(ValueError) as err:
419419
workflow.init(BadWorkflowInit.not__init__)
420420
assert "@workflow.init may only be used on the __init__ method" in str(err.value)
421+
422+
423+
class BadUpdateValidator:
424+
@workflow.update
425+
def my_update(self, a: str):
426+
pass
427+
428+
@my_update.validator # type: ignore
429+
def my_validator(self, a: int):
430+
pass
431+
432+
@workflow.run
433+
async def run(self):
434+
pass
435+
436+
437+
def test_workflow_update_validator_not_update():
438+
with pytest.raises(ValueError) as err:
439+
workflow.defn(BadUpdateValidator)
440+
assert (
441+
"Update validator method my_validator parameters do not match update method my_update parameters"
442+
in str(err.value)
443+
)

0 commit comments

Comments
 (0)