code: def test_config_context():
      with pytest.raises(AttributeError):
          _ = options.a.b.c
  
      options.register_option("c.d.e", "a", is_string)
      assert "c" in dir(options)
      assert "d" in dir(options.c)
  
      try:
          with option_context() as ctx:
              ctx.register_option("a.b.c", 1, validator=is_integer)
              assert ctx.a.b.c == 1
  
              ctx.a.b.c = 2
              assert ctx.a.b.c == 2
  
              with pytest.raises(ValueError):
                  ctx.a.b.c = "a"
  
              assert ctx.c.d.e == "a"
  
              ctx.c.d.e = "b"
  
          assert options.c.d.e == "a"
  
          options.c.d.e = "c"
  
          assert options.c.d.e == "c"
  
          with pytest.raises(AttributeError):
              _ = options.a.b.c  # noqa: F841
      finally:
          options.unregister_option("c.d.e")
  
file_path: mars/mars/tests/test_config.py
imports: import pickle
  import threading
  import pytest
  from ..config import options, option_context, is_integer, is_string, Config
label_desc: Use image node_id 1 for calling a global function with example usage: test_config_context() without return types