Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove duplicate testing code in test_function. #23591

Merged
merged 1 commit into from
Sep 14, 2023
Merged
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
20 changes: 1 addition & 19 deletions ivy_tests/test_ivy/helpers/function_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,32 +248,14 @@ 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(
ivy_backend.nested_multi_map(
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"
Expand Down
Loading