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

Function test_reallocation_d

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

Source from the content-addressed store, hash-verified

413
414@pytest.mark.skipif("env.GRAALPY", reason="Cannot reliably trigger GC")
415def test_reallocation_d(capture, msg):
416 with capture:
417 create_and_destroy(2.5, 3)
418 assert msg(capture) == strip_comments(
419 """
420 NoisyAlloc(double 2.5) # construction (local func variable: operator_new not called)
421 noisy new # return-by-value "new" part 1: allocation
422 ~NoisyAlloc() # moved-away local func variable destruction
423 ---
424 ~NoisyAlloc() # Destructor
425 noisy delete # operator delete
426 """
427 )
428
429
430@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