code: def test_user_scalar_fails_buffer(self):
      r = rational(1)
      with assert_raises(TypeError):
          memoryview(r)
  
      # Check that we do not allow writeable buffer export
      with pytest.raises(
          BufferError, match="scalar buffer is readonly"
      ):
          get_buffer_info(r, ["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 9 for calling the TestScalarPEP3118 obj's underlying member method code with example usage: obj.test_user_scalar_fails_buffer() without return types