code: def test_datetime_memoryview(self):
      # gh-11656
      # Values verified with v1.13.3, shape is not () as in test_scalar_dim
  
      dt1 = np.datetime64("2016-01-01")
      dt2 = np.datetime64("2017-01-01")
      expected = dict(
          strides=(1,),
          itemsize=1,
          ndim=1,
          shape=(8,),
          format="B",
          readonly=True,
      )
      v = memoryview(dt1)
      assert self._as_dict(v) == expected
  
      v = memoryview(dt2 - dt1)
      assert self._as_dict(v) == expected
  
      dt = np.dtype([("a", "uint16"), ("b", "M8[s]")])
      a = np.empty(1, dt)
      # Fails to create a PEP 3118 valid buffer
      assert_raises((ValueError, BufferError), memoryview, a[0])
  
      # Check that we do not allow writeable buffer export
      with pytest.raises(
          BufferError, match="scalar buffer is readonly"
      ):
          get_buffer_info(dt1, ["WRITABLE"])
  
file_path: catboost/contrib/python/numpy/py3/numpy/core/tests/test_scalarbuffer.py
imports: import numpy
  from numpy.core._rational_tests import rational
  from numpy.core._multiarray_tests import get_buffer_info
  import pytest
  from numpy.testing import assert_, assert_equal, assert_raises
label_desc: Use image node_id 7 for calling the TestScalarPEP3118 obj's underlying member method code with example usage: obj.test_datetime_memoryview() without return types