From 9010913161ece72703198f1303dcc92c2079f5a6 Mon Sep 17 00:00:00 2001 From: Mostafa Hani <71686115+CatB1t@users.noreply.github.com> Date: Thu, 14 Sep 2023 13:06:01 +0300 Subject: [PATCH] fix(testing): remove duplicate code in `test_function`. (#23591) --- .../test_ivy/helpers/function_testing.py | 20 +------------------ 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/ivy_tests/test_ivy/helpers/function_testing.py b/ivy_tests/test_ivy/helpers/function_testing.py index 98790f9cd20e2..d93549adf331e 100644 --- a/ivy_tests/test_ivy/helpers/function_testing.py +++ b/ivy_tests/test_ivy/helpers/function_testing.py @@ -248,7 +248,7 @@ def test_function_backend_computation( lambda x, _: x[0] is x[1], [test_ret, out] ), lambda x: not x, - ) + ), "the array in out argument does not contain same value as the returned" if not max(test_flags.container) and ivy_backend.native_inplace_support: # these backends do not always support native inplace updates assert not ivy_backend.nested_any( @@ -256,24 +256,6 @@ def test_function_backend_computation( lambda x, _: x[0].data is x[1].data, [test_ret, out] ), lambda x: not x, - ) - # TODO use context manager - test_ret = ( - ret_from_target[getattr(ivy.__dict__[fn_name], "out_index")] - if hasattr(ivy.__dict__[fn_name], "out_index") - else ret_from_target - ) - assert not ivy.nested_any( - ivy.nested_multi_map(lambda x, _: x[0] is x[1], [test_ret, out]), - lambda x: not x, - ), "the array in out argument does not contain same value as the returned" - if not max(test_flags.container) and ivy_backend.native_inplace_support: - # these backends do not always support native inplace updates - assert not ivy.nested_any( - ivy.nested_multi_map( - lambda x, _: x[0].data is x[1].data, [test_ret, out] - ), - lambda x: not x, ), ( "the array in out argument does not contain same value as the" " returned"