code: def test_init_and_postinit():
      class Foo(eqx.Module):
          field: jax.Array = eqx.field(converter=jnp.asarray)
  
          def __post_init__(self):
              assert False
  
      with pytest.warns(
          UserWarning, match="__init__` method and a `__post_init__"
      ):
  
          class Bar(Foo):
              def __init__(self):
                  self.field = 1  # pyright: ignore
  
      assert tree_allclose(Bar().field, jnp.array(1))
  
      class Qux(eqx.Module):
          field: jax.Array = eqx.field(converter=jnp.asarray)
  
          def __init__(self):
              self.field = 1  # pyright: ignore
  
      with pytest.warns(
          UserWarning, match="__init__` method and a `__post_init__"
      ):
  
          class Quux(Qux):
              def __post_init__(self):
                  assert False
  
      assert tree_allclose(Quux().field, jnp.array(1))
  
imports: import abc
  import dataclasses
  import functools
  import inspect
  from collections.abc import Callable
  from dataclasses import InitVar
  from typing import Any, Optional
  import equinox
  import equinox.internal
  import jax
  import jax.numpy
  import jax.tree_util
  import pytest
  from .helpers import tree_allclose
label_desc: Use image node_id 15 for calling a global function with example usage: test_init_and_postinit() without return types