diff --git a/tests/nexus/test_handler_interface_implementation.py b/tests/nexus/test_handler_interface_implementation.py index 35289e188..f20f25a04 100644 --- a/tests/nexus/test_handler_interface_implementation.py +++ b/tests/nexus/test_handler_interface_implementation.py @@ -44,11 +44,29 @@ async def op( error_message = None +class MissingWorkflowRunDecorator(_InterfaceImplementationTestCase): + """Missing @workflow_run_operation decorator raises appropriate error.""" + + @nexusrpc.service + class Interface: + my_workflow_op: nexusrpc.Operation[str, int] + + class Impl: + # Method exists but MISSING @workflow_run_operation decorator + async def my_workflow_op( + self, _ctx: WorkflowRunOperationContext, _input: str + ) -> nexus.WorkflowHandle[int]: + raise NotImplementedError + + error_message = "does not implement an operation with method name 'my_workflow_op'" + + @pytest.mark.parametrize( "test_case", [ ValidImpl, ValidWorkflowRunImpl, + MissingWorkflowRunDecorator, ], ) def test_service_decorator_enforces_interface_conformance( @@ -56,7 +74,9 @@ def test_service_decorator_enforces_interface_conformance( ): if test_case.error_message: with pytest.raises(Exception) as ei: - nexusrpc.handler.service_handler(test_case.Interface)(test_case.Impl) + nexusrpc.handler.service_handler(service=test_case.Interface)( + test_case.Impl + ) err = ei.value assert test_case.error_message in str(err) else: diff --git a/tests/nexus/test_workflow_caller.py b/tests/nexus/test_workflow_caller.py index 273581302..4d54c6123 100644 --- a/tests/nexus/test_workflow_caller.py +++ b/tests/nexus/test_workflow_caller.py @@ -902,9 +902,6 @@ async def run( return await nexus_client.execute_operation(service_cls.op, None) # type: ignore -# TODO(nexus-prerelease): check missing decorator behavior - - async def test_service_interface_and_implementation_names( client: Client, env: WorkflowEnvironment ):