code: def test_reallocation_a(capture, msg):
      """When the constructor is overloaded, previous overloads can require a preallocated value.
      This test makes sure that such preallocated values only happen when they might be necessary,
      and that they are deallocated properly."""
  
      pytest.gc_collect()
  
      with capture:
          create_and_destroy(1)
      assert (
          msg(capture)
          == """
          noisy new
          noisy placement new
          NoisyAlloc(int 1)
          ---
          ~NoisyAlloc()
          noisy delete
      """
      )
  
imports: import re
  import pytest
  from pybind11_tests import ConstructorStats
  from pybind11_tests import factory_constructors
  from pybind11_tests.factory_constructors import tag
label_desc: Use image node_id 10 for calling a global function with example usage: test_reallocation_a(capture, msg) without return types