code: def test_numpy_view(capture):
      from pybind11_tests.array import ArrayClass
  
      with capture:
          ac = ArrayClass()
          ac_view_1 = ac.numpy_view()
          ac_view_2 = ac.numpy_view()
          assert np.all(ac_view_1 == np.array([1, 2], dtype=np.int32))
          del ac
          pytest.gc_collect()
      assert (
          capture
          == """
          ArrayClass()
          ArrayClass::numpy_view()
          ArrayClass::numpy_view()
      """
      )
      ac_view_1[0] = 4
      ac_view_1[1] = 3
      assert ac_view_2[0] == 4
      assert ac_view_2[1] == 3
      with capture:
          del ac_view_1
          del ac_view_2
          pytest.gc_collect()
          pytest.gc_collect()
      assert (
          capture
          == """
          ~ArrayClass()
      """
      )
  
file_path: turicreate/src/external/coremltools_wrap/coremltools/deps/pybind11/tests/test_numpy_array.py
imports: import pytest
label_desc: Use image node_id 13 for calling a global function with example usage: test_numpy_view(capture) without return types