diff --git a/azure_functions_worker/bindings/generic.py b/azure_functions_worker/bindings/generic.py index 9d0cca8af..b5a89c926 100644 --- a/azure_functions_worker/bindings/generic.py +++ b/azure_functions_worker/bindings/generic.py @@ -52,4 +52,4 @@ def decode(cls, data: datumdef.Datum, *, trigger_metadata) -> typing.Any: @classmethod def has_implicit_output(cls) -> bool: - return False + return True diff --git a/tests/unittests/test_mock_generic_functions.py b/tests/unittests/test_mock_generic_functions.py index 32004850f..bb07a15cf 100644 --- a/tests/unittests/test_mock_generic_functions.py +++ b/tests/unittests/test_mock_generic_functions.py @@ -131,7 +131,7 @@ async def test_mock_generic_should_not_support_implicit_output(self): protos.StatusResult.Success) _, r = await host.invoke_function( - 'foobar_as_bytes_no_anno', [ + 'foobar_implicit_output', [ protos.ParameterBinding( name='input', data=protos.TypedData( @@ -140,10 +140,10 @@ async def test_mock_generic_should_not_support_implicit_output(self): ) ] ) - # It should fail here, since generic binding requires - # $return statement in function.json to pass output + # It passes now as we are enabling generic binding to return output + # implicitly self.assertEqual(r.response.result.status, - protos.StatusResult.Failure) + protos.StatusResult.Success) async def test_mock_generic_should_support_without_datatype(self): async with testutils.start_mockhost( @@ -166,7 +166,7 @@ async def test_mock_generic_should_support_without_datatype(self): ) ] ) - # It should fail here, since the generic binding requires datatype - # to be defined in function.json + # It passes now as we are enabling generic binding to return output + # implicitly self.assertEqual(r.response.result.status, - protos.StatusResult.Failure) + protos.StatusResult.Success)