code: def test_bad_array_like_attributes(self, attribute, error):
      # RecursionError and MemoryError are considered fatal. All errors
      # (except AttributeError) should probably be raised in the future,
      # but shapely made use of it, so it will require a deprecation.
  
      class BadInterface:
          def __getattr__(self, attr):
              if attr == attribute:
                  raise error
              super().__getattr__(attr)
  
      with pytest.raises(error):
          np.array(BadInterface())
  
imports: from itertools import permutations, product
  import pytest
  from pytest import param
  import numpy
  from numpy.core._rational_tests import rational
  from numpy.core._multiarray_umath import _discover_array_parameters
  from numpy.testing import assert_array_equal, assert_warns, IS_PYPY
label_desc: Use image node_id 6 for calling the TestArrayLikes obj's underlying member method code with example usage: obj.test_bad_array_like_attributes(attribute, error) without return types