def test_lambda_closure_cleanup(): from pybind11_tests import test_cleanup, payload_cstats test_cleanup() cstats = payload_cstats() assert cstats.alive() == 0 assert cstats.copy_constructions == 1 assert cstats.move_constructions >= 1
def test_lambda_closure_cleanup(): from pybind11_tests import test_cleanup, payload_cstats test_cleanup() cstats = payload_cstats() if cstats.alive() != 0: raise AssertionError if cstats.copy_constructions != 1: raise AssertionError if cstats.move_constructions < 1: raise AssertionError