code: def test_dict_field():
      hp = Trickier()
      hp.override_from_pairs([("dict_field", dict())])
      assert hp == Trickier.from_json(dict(dict_field=dict()))
      assert hp.dict_field == dict()
      hp.override_from_json(dict(dict_field=dict(a=3, b=4)))
      assert hp == Trickier.from_json(dict(dict_field=dict(a=3, b=4)))
      assert hp.to_json() == dict(
          dict_field=dict(a=3, b=4),
          tuple_list_field=None,
          list_tuple_field=None,
          nested_dict_field=None,
      )
      assert hp.dict_field == dict(a=3, b=4)
      with pytest.raises(TypeError):
          hp.override_from_json(dict(dict_field=dict(a="hmm", b=4)))
      assert hp.dict_field == dict(a=3, b=4)
      # overrides entire dict
      hp.override_from_json(dict(dict_field=dict(c=5)))
      assert hp.dict_field == dict(c=5)
      with pytest.raises(TypeError):
          hp.override_from_json(dict(dict_field=None))
      with pytest.raises(TypeError):
          hp.override_from_pair("dict_field", None)
  
      with pytest.raises(TypeError):
          hp.validate()  # nested_dict_field unset
      hp.override_from_pair("nested_dict_field", dict())
      hp.validate()
      assert hp == hp.clone()
  
imports: from dataclasses import dataclass, field
  from typing import Optional, Dict, List, Tuple, Union
  import pytest
  from summarize_from_feedback.utils import hyperparams
label_desc: Use image node_id 9 for calling a global function with example usage: test_dict_field() without return types