MCPcopy Create free account
hub / github.com/pybind/pybind11 / test_reallocation_b

Function test_reallocation_b

tests/test_factory_constructors.py:383–396  ·  view source on GitHub ↗
(capture, msg)

Source from the content-addressed store, hash-verified

381
382@pytest.mark.skipif("env.GRAALPY", reason="Cannot reliably trigger GC")
383def test_reallocation_b(capture, msg):
384 with capture:
385 create_and_destroy(1.5)
386 assert msg(capture) == strip_comments(
387 """
388 noisy new # allocation required to attempt first overload
389 noisy delete # have to dealloc before considering factory init overload
390 noisy new # pointer factory calling "new", part 1: allocation
391 NoisyAlloc(double 1.5) # ... part two, invoking constructor
392 ---
393 ~NoisyAlloc() # Destructor
394 noisy delete # operator delete
395 """
396 )
397
398
399@pytest.mark.skipif("env.GRAALPY", reason="Cannot reliably trigger GC")

Callers

nothing calls this directly

Calls 3

create_and_destroyFunction · 0.85
msgFunction · 0.85
strip_commentsFunction · 0.85

Tested by

no test coverage detected