code: def test_readonly(self) -> None:
      class ReadonlyModel(HasProps):
          x = Readonly(Int, default=12)  # with default
          y = Readonly(Int)
          z = String("hello")
  
      o = ReadonlyModel()
      assert o.x == 12
      with pytest.raises(UnsetValueError):
          o.y
      assert o.z == "hello"
  
      # readonly props are still in the list of props
      assert "x" in o.properties()
      assert "y" in o.properties()
      assert "z" in o.properties()
  
      assert "x" in o.properties_with_values(include_defaults=True)
      assert "y" not in o.properties_with_values(include_defaults=True)
      assert "z" in o.properties_with_values(include_defaults=True)
  
      assert "x" not in o.properties_with_values(include_defaults=False)
      assert "y" not in o.properties_with_values(include_defaults=False)
      assert "z" not in o.properties_with_values(include_defaults=False)
  
      with pytest.raises(RuntimeError):
          o.x = 7
      with pytest.raises(RuntimeError):
          o.y = 7
      o.z = "xyz"
  
      assert o.x == 12
      with pytest.raises(UnsetValueError):
          o.y
      assert o.z == "xyz"
  
      obj0 = ReadonlyModel(x=20)
      with pytest.raises(
          RuntimeError, match="ReadonlyModel.x is a readonly property"
      ):
          obj0.x = 30
  
      obj1 = ReadonlyModel(y=30)
      with pytest.raises(
          RuntimeError, match="ReadonlyModel.y is a readonly property"
      ):
          obj1.y = 40
  
      obj2 = ReadonlyModel(x=20, y=30)
      with pytest.raises(
          RuntimeError, match="ReadonlyModel.x is a readonly property"
      ):
          obj2.update(x=30, y=40)
  
imports: from __future__ import annotations
  import pytest
  import numpy
  from bokeh.core.has_props import HasProps, Local
  from bokeh.core.properties import Alias, Dict, Enum, Float, Instance, Int, List, NotSerialized, Nullable, NumberSpec, Override, Readonly, String, UnsetValueError
  from bokeh.model import Model
  from tests.support.util.api import verify_all
  import bokeh.core.properties
label_desc: Use image node_id 8 for calling the TestBasic obj's underlying member method code with example usage: obj.test_readonly() without return types