code: def test_replace_unknown_fields_error(self):
      class Foo(nnx.Pytree):
          pass
  
      with pytest.raises(
          ValueError, match="Trying to replace unknown fields"
      ):
          Foo().replace(y=1)
  
file_path: flax/flax/experimental/nnx/tests/test_pytree.py
imports: from typing import Generic, TypeVar
  import jax
  import pytest
  from flax import serialization
  from flax.experimental import nnx
label_desc: Use image node_id 7 for calling the TestPytree obj's underlying member method code with example usage: obj.test_replace_unknown_fields_error() without return types