Fix for issue #8023

Can someone code review.
I think you can just pass the `np_array` and `assert_equal` arguments, as this will mask wrong arguments